ext4: add explicit casts when masking cluster sizes
authorTheodore Ts'o <tytso@mit.edu>
Fri, 20 Dec 2013 14:29:35 +0000 (09:29 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 15 Feb 2014 19:20:15 +0000 (19:20 +0000)
commitf3f8d67db827d4206999fc81bca6df60c96c9448
tree035875f67069e9cd672e9ddae28761816627e6bf
parentdb2d65517d27bda1164ab41aba72e13a2e56b468
ext4: add explicit casts when masking cluster sizes

commit f5a44db5d2d677dfbf12deee461f85e9ec633961 upstream.

The missing casts can cause the high 64-bits of the physical blocks to
be lost.  Set up new macros which allows us to make sure the right
thing happen, even if at some point we end up supporting larger
logical block numbers.

Thanks to the Emese Revfy and the PaX security team for reporting this
issue.

Reported-by: PaX Team <pageexec@freemail.hu>
Reported-by: Emese Revfy <re.emese@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
[bwh: Backported to 3.2:
 - Adjust context
 - Drop inapplicable change to ext4_ext_rm_leaf()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/mballoc.c