1
0
Fork 0
alistair23-linux/fs/hfs
Colin Ian King 6c9a3f843a fs/hfs/extent.c: fix array out of bounds read of array extent
Currently extent and index i are both being incremented causing an array
out of bounds read on extent[i].  Fix this by removing the extraneous
increment of extent.

Ernesto said:

: This is only triggered when deleting a file with a resource fork.  I
: may be wrong because the documentation isn't clear, but I don't think
: you can create those under linux.  So I guess nobody was testing them.
:
: > A disk space leak, perhaps?
:
: That's what it looks like in general.  hfs_free_extents() won't do
: anything if the block count doesn't add up, and the error will be
: ignored.  Now, if the block count randomly does add up, we could see
: some corruption.

Detected by CoverityScan, CID#711541 ("Out of bounds read")

Link: http://lkml.kernel.org/r/20180831140538.31566-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ernesto A. Fernndez <ernesto.mnd.fernandez@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-31 08:54:13 -07:00
..
Kconfig fs/hfs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:05 -08:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
attr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bfind.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bitmap.c hfs/hfsplus: convert dprint to hfs_dbg 2013-04-30 17:04:05 -07:00
bnode.c hfs/hfsplus: clean up unused variables in bnode.c 2017-11-17 16:10:03 -08:00
brec.c hfs: fix BUG on bnode parent update 2018-10-31 08:54:13 -07:00
btree.c hfs: prevent btree data loss on ENOSPC 2018-10-31 08:54:13 -07:00
btree.h hfs: prevent btree data loss on ENOSPC 2018-10-31 08:54:13 -07:00
catalog.c hfs: prevent btree data loss on ENOSPC 2018-10-31 08:54:13 -07:00
dir.c hfs: use d_splice_alias() 2018-05-22 14:27:59 -04:00
extent.c fs/hfs/extent.c: fix array out of bounds read of array extent 2018-10-31 08:54:13 -07:00
hfs.h address hfs on-disk corruption robustness review comments 2008-02-06 10:41:05 -08:00
hfs_fs.h Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
inode.c hfs: update timestamp on truncate() 2018-10-31 08:54:13 -07:00
mdb.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
part_tbl.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.c get rid of 'parent' argument of ->d_compare() 2016-07-31 16:37:25 -04:00
super.c Rename superblock flags (MS_xyz -> SB_xyz) 2017-11-27 13:05:09 -08:00
sysdep.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
trans.c qstr: constify instances in hfs 2016-07-20 23:30:06 -04:00