linux/fs/omfs
Bob Copeland c0345ee57d omfs: fix sign confusion for bitmap loop counter
The count variable is used to iterate down to (below) zero from the size
of the bitmap and handle the one-filling the remainder of the last
partial bitmap block.  The loop conditional expects count to be signed
in order to detect when the final block is processed, after which count
goes negative.

Unfortunately, a recent change made this unsigned along with some other
related fields.  The result of is this is that during mount,
omfs_get_imap will overrun the bitmap array and corrupt memory unless
number of blocks happens to be a multiple of 8 * blocksize.

Fix by changing count back to signed: it is guaranteed to fit in an s32
without overflow due to an enforced limit on the number of blocks in the
filesystem.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-05-28 18:25:19 -07:00
..
bitmap.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
dir.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
file.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
inode.c omfs: fix sign confusion for bitmap loop counter 2015-05-28 18:25:19 -07:00
Kconfig fs/Kconfig: move omfs out 2009-01-22 13:15:58 +03:00
Makefile omfs: update kbuild to include OMFS 2008-07-26 12:00:05 -07:00
omfs_fs.h FS/OMFS: block number sanity check during fill_super operation 2014-10-14 02:18:22 +02:00
omfs.h userns: Convert omfs to use kuid and kgid where appropriate 2012-09-21 03:13:16 -07:00