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
..
2018-10-30 08:27:13 -07:00
2018-09-04 11:35:03 +08:00
2018-08-21 23:54:17 -04:00
\n
2018-10-29 10:23:36 -07:00
2018-08-21 18:47:36 -07:00
2018-08-17 16:20:28 -07:00
2018-09-29 22:47:48 -04:00
2018-10-26 16:26:33 -07:00
2018-05-22 14:27:52 -04:00
2018-10-21 10:46:42 -04:00
2018-08-17 16:20:27 -07:00
2018-10-24 14:42:02 +01:00
2018-05-22 14:27:52 -04:00
2018-08-18 11:44:53 -07:00
2018-09-07 10:32:23 +02:00
2018-10-18 17:21:55 +11:00
2018-07-03 16:44:45 -04:00
2018-08-14 10:23:25 -07:00
2018-10-29 14:29:58 -07:00
2018-06-05 19:23:26 +02:00
2018-08-21 18:19:09 -07:00
2018-10-21 10:46:42 -04:00
2018-10-21 10:46:44 -04:00
2018-08-21 18:19:09 -07:00
2018-06-11 08:22:34 -07:00
2018-08-21 18:19:09 -07:00
2018-02-15 15:34:42 -05:00
2018-08-21 18:19:09 -07:00
2018-09-03 15:14:01 +02:00
2018-04-04 12:44:02 -07:00