summaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2015-05-29 00:44:35 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-29 03:25:19 +0200
commitc0345ee57d461343586b5e1e2f9c3c3766d07fe6 (patch)
treebd81e1024685902b89855d40aff995a89acb17b3 /fs/pipe.c
parentomfs: set error return when d_make_root() fails (diff)
downloadlinux-c0345ee57d461343586b5e1e2f9c3c3766d07fe6.tar.xz
linux-c0345ee57d461343586b5e1e2f9c3c3766d07fe6.zip
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>
Diffstat (limited to 'fs/pipe.c')
0 files changed, 0 insertions, 0 deletions