An error occurred while fetching folder content.
ceph: avoid 32-bit page index overflow
Alex Elder authored
(cherry picked from commit 6285bc23)

A pgoff_t is defined (by default) to have type (unsigned long).  On
architectures such as i686 that's a 32-bit type.  The ceph address
space code was attempting to produce 64 bit offsets by shifting a
page's index by PAGE_CACHE_SHIFT, but the result was not what was
desired because the shift occurred before the result got promoted
to 64 bits.

Fix this by converting all uses of page->index used in this way to
use the page_offset() macro, which ensures the 64-bit result has the
intended value.

This fixes http://tracker.newdream.net/issues/3112

Reported-by: default avatarMohamed Pakkeer <pakkeer.mohideen@realimage.com>
Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarSage Weil <sage@inktank.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
b7d68a74
Name Last commit Last update
..
9p Merge tag 'for-linus-3.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
adfs switch open-coded instances of d_make_root() to new helper
affs switch open-coded instances of d_make_root() to new helper
afs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
autofs4 autofs4 - fix reset pending flag on mount fail
befs switch open-coded instances of d_make_root() to new helper
bfs switch open-coded instances of d_make_root() to new helper
btrfs Btrfs: call the ordered free operation without any locks held
cachefiles switch touch_atime to struct path
ceph ceph: avoid 32-bit page index overflow
cifs cifs: fix potential buffer overrun in cifs.idmap handling code
coda Remove all #inclusions of asm/system.h
configfs make configfs_pin_fs() return root dentry on success
cramfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
debugfs simple_open: automatically convert to simple_open()
devpts Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
dlm Merge tag 'dlm-fixes-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
ecryptfs eCryptfs: check for eCryptfs cipher support at mount
efs switch open-coded instances of d_make_root() to new helper
exofs ore: Fix out-of-bounds access in _ios_obj()
exportfs vfs: Add open by file handle support
ext2 migrate ext2_fs.h guts to fs/ext2/ext2.h
ext3 ext3: Fix fdatasync() for files with only i_size changes
ext4 ext4: fix unjournaled inode bitmap modification
fat fat: fix bug in enforcing Long File Name length
freevxfs
fscache
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
logfs
minix
ncpfs
nfs
nfs_common
nfsd
nilfs2
nls
notify
ntfs
ocfs2
omfs
openpromfs
proc
pstore
qnx4
qnx6
quota
ramfs
reiserfs
romfs
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c