linux/fs
Alex Elder eebefbf469 xfs: zero proper structure size for geometry calls
commit af24ee9ea8 upstream.

Commit 493f3358cb added this call to
xfs_fs_geometry() in order to avoid passing kernel stack data back
to user space:

+       memset(geo, 0, sizeof(*geo));

Unfortunately, one of the callers of that function passes the
address of a smaller data type, cast to fit the type that
xfs_fs_geometry() requires.  As a result, this can happen:

Kernel panic - not syncing: stack-protector: Kernel stack is corrupted
in: f87aca93

Pid: 262, comm: xfs_fsr Not tainted 2.6.38-rc6-493f3358cb2+ #1
Call Trace:

[<c12991ac>] ? panic+0x50/0x150
[<c102ed71>] ? __stack_chk_fail+0x10/0x18
[<f87aca93>] ? xfs_ioc_fsgeometry_v1+0x56/0x5d [xfs]

Fix this by fixing that one caller to pass the right type and then
copy out the subset it is interested in.

Note: This patch is an alternative to one originally proposed by
Eric Sandeen.

Reported-by: Jeffrey Hundstad <jeffrey.hundstad@mnsu.edu>
Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Tested-by: Jeffrey Hundstad <jeffrey.hundstad@mnsu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-14 16:53:56 -07:00
..
9p 9p: Skip check for mandatory locks when unlocking 2010-04-26 07:41:29 -07:00
adfs adfs: remove redundant test on unsigned 2009-09-24 07:21:05 -07:00
affs fix affs parse_options() 2010-02-09 04:50:48 -08:00
afs FS-Cache: Handle pages pending storage that get evicted under OOM conditions 2009-11-19 18:11:35 +00:00
autofs trivial: remove unnecessary semicolons 2009-09-21 15:14:58 +02:00
autofs4
befs befs: fix leak 2010-02-23 07:37:55 -08:00
bfs Fix failure exits in bfs_fill_super() 2010-02-09 04:50:46 -08:00
btrfs Btrfs: Fix uninitialized root flags for subvolumes 2011-04-14 16:53:27 -07:00
cachefiles CacheFiles: Fix error handling in cachefiles_determine_cache_security() 2010-05-26 14:29:20 -07:00
cifs CIFS: Fix oplock break handling (try #2) 2011-03-07 15:17:59 -08:00
coda headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
configfs
cramfs
debugfs debugfs: fix create mutex racy fops and private data 2009-12-18 14:04:16 -08:00
devpts devpts_get_tty() should validate inode 2009-12-18 14:04:15 -08:00
dlm dlm: send reply before bast 2010-08-13 13:20:21 -07:00
ecryptfs eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix 2011-04-14 16:53:21 -07:00
efs
exofs exofs: confusion between kmap() and kmap_atomic() api 2010-07-05 11:10:47 -07:00
exportfs
ext2 ext2: Fix link count corruption under heavy link+rename load 2011-03-07 15:17:54 -08:00
ext3 ext3: skip orphan cleanup on rocompat fs 2011-03-27 11:30:35 -07:00
ext4 ext4: fix credits computing for indirect mapped files 2011-04-14 16:53:46 -07:00
fat fat: fix buffer overflow in vfat_create_shortname() 2010-04-26 07:41:13 -07:00
freevxfs
fscache FS-Cache: Provide nop fscache_stat_d() if CONFIG_FSCACHE_STATS=n 2009-11-20 21:50:44 +00:00
fuse fuse: fix hang of single threaded fuseblk filesystem 2011-03-07 15:17:53 -08:00
gfs2 GFS2: Fix bmap allocation corner-case bug 2011-03-02 09:46:44 -05:00
hfs hfs: fix a potential buffer overflow 2009-12-18 14:04:08 -08:00
hfsplus hfsplus: refuse to mount volumes larger than 2TB 2009-10-29 07:39:27 -07:00
hostfs
hpfs
hppfs
hugetlbfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-09-24 08:32:11 -07:00
isofs fs: Make unload_nls() NULL pointer safe 2009-09-24 07:47:42 -04:00
jbd jbd: jbd-debug and jbd2-debug should be writable 2010-07-05 11:11:20 -07:00
jbd2 ext4, jbd2: Add barriers for file systems with exernal journals 2010-08-02 10:21:10 -07:00
jffs2 jffs2: Fix long-standing bug with symlink garbage collection. 2009-12-18 14:05:52 -08:00
jfs jfs: don't allow os2 xattr namespace overlap with others 2010-08-13 13:19:48 -07:00
lockd headers: utsname.h redux 2009-09-23 18:13:10 -07:00
minix V3 minixfs: add missing directory type checking 2009-09-23 07:39:57 -07:00
ncpfs const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
nfs NFS: fix the return value of nfs_file_fsync() 2011-03-02 09:46:40 -05:00
nfs_common
nfsd nfsd: fix auth_domain reference leak on nlm operations 2011-04-14 16:53:47 -07:00
nilfs2 nilfs2: fix data loss in mmap page write for hole blocks 2011-04-14 16:53:26 -07:00
nls Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2009-09-30 09:31:14 -07:00
notify inotify: fix inotify oneshot support 2010-09-26 17:21:38 -07:00
ntfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-09-24 08:32:11 -07:00
ocfs2 Treat writes as new when holes span across page boundaries 2011-04-14 16:53:34 -07:00
omfs const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
openpromfs
partitions ldm: corrupted partition table can cause kernel oops 2011-03-02 09:47:05 -05:00
proc proc: protect mm start_code/end_code in /proc/pid/stat 2011-03-27 11:30:37 -07:00
qnx4 qnx4: remove write support 2009-09-23 07:39:30 -07:00
quota quota: Don't write quota info in dquot_commit() 2011-04-14 16:53:30 -07:00
ramfs truncate: use new helpers 2009-09-24 08:41:47 -04:00
reiserfs reiserfs: fix oops while creating privroot with selinux enabled 2010-08-13 13:20:20 -07:00
romfs fix leak in romfs_fill_super() 2010-02-09 04:50:47 -08:00
smbfs fs: Make unload_nls() NULL pointer safe 2009-09-24 07:47:42 -04:00
squashfs Squashfs: handle corruption of directory structure 2011-04-14 16:53:44 -07:00
sysfs sysfs: checking for NULL instead of ERR_PTR 2010-09-20 13:17:50 -07:00
sysv
ubifs UBIFS: fix debugging failure in dbg_check_space_info 2011-04-14 16:53:29 -07:00
udf udf: Try harder when looking for VAT inode 2010-01-06 15:05:00 -08:00
ufs
xfs xfs: zero proper structure size for geometry calls 2011-04-14 16:53:56 -07:00
aio.c aio: wake all waiters when destroying ctx 2011-03-27 11:30:26 -07:00
anon_inodes.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
attr.c truncate: new helpers 2009-09-24 08:41:47 -04:00
bad_inode.c
binfmt_aout.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_elf_fdpic.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_elf.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_em86.c
binfmt_flat.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_misc.c binfmt_misc: fix binfmt_misc priority 2010-09-20 13:17:54 -07:00
binfmt_script.c
binfmt_som.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
bio-integrity.c block: fix bugs in bio-integrity mempool usage 2010-02-09 04:50:58 -08:00
bio.c bio: take care not overflow page count when mapping/copying user data 2010-12-09 13:26:52 -08:00
block_dev.c blkdev: cgroup whitelist permission fix 2010-08-13 13:19:37 -07:00
buffer.c Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block 2009-09-25 09:27:30 -07:00
char_dev.c char: Mark /dev/zero and /dev/kmem as not capable of writeback 2010-09-26 17:21:26 -07:00
compat_binfmt_elf.c
compat_ioctl.c fs: add missing compat_ptr handling for FS_IOC_RESVSP ioctl 2009-11-12 07:25:57 -08:00
compat.c exec: copy-and-paste the fixes into compat_do_execve() paths 2011-04-14 16:53:55 -07:00
dcache.c fs: call security_d_instantiate in d_obtain_alias V2 2011-03-27 11:30:50 -07:00
dcookies.c
direct-io.c
drop_caches.c sysctl: remove "struct file *" argument of ->proc_handler 2009-09-24 07:21:04 -07:00
eventfd.c anonfd: split interface into file creation and install 2009-09-23 07:39:29 -07:00
eventpoll.c epoll: prevent creating circular epoll structures 2011-03-02 09:47:04 -05:00
exec.c exec: copy-and-paste the fixes into compat_do_execve() paths 2011-04-14 16:53:55 -07:00
fcntl.c Fix race in tty_fasync() properly 2010-02-23 07:37:44 -08:00
fifo.c
file_table.c CRED: Fix kernel panic upon security_file_alloc() failure. 2011-03-02 09:46:38 -05:00
file.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
filesystems.c
fs_struct.c
fs-writeback.c writeback: disable periodic old data writeback for !dirty_writeback_centisecs 2010-07-05 11:10:45 -07:00
generic_acl.c
inode.c vfs: optimize touch_time() too 2009-09-24 07:47:27 -04:00
internal.h fs: fix overflow in sys_mount() for in-kernel calls 2009-09-24 08:40:15 -04:00
ioctl.c __generic_block_fiemap(): fix for files bigger than 4GB 2009-11-12 07:26:01 -08:00
ioprio.c
Kconfig powerpc: Cleanup Kconfig selection of hugetlbfs support 2009-10-30 15:03:54 +11:00
Kconfig.binfmt
libfs.c wrong type for 'magic' argument in simple_fill_super() 2010-07-05 11:11:12 -07:00
locks.c const: make lock_manager_operations const 2009-09-22 07:17:25 -07:00
Makefile
mbcache.c
mpage.c
namei.c fix LOOKUP_FOLLOW on automount "symlinks" 2010-03-15 08:49:32 -07:00
namespace.c vfs: add NOFOLLOW flag to umount(2) 2010-07-05 11:11:15 -07:00
nfsctl.c
no-block.c
open.c fs: change sys_truncate length parameter type 2009-09-23 09:21:05 -07:00
pipe.c pipe: fix failure to return error code on ->confirm() 2010-11-22 10:47:34 -08:00
pnode.c
pnode.h
posix_acl.c
read_write.c sendfile(): check f_op.splice_write() rather than f_op.sendpage() 2011-03-02 09:46:40 -05:00
read_write.h
readdir.c
select.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
seq_file.c vfs: seq_file: add helpers for data filling 2009-09-24 07:47:35 -04:00
signalfd.c signalfd: fill in ssi_int for posix timers and message queues 2010-08-13 13:19:39 -07:00
splice.c sendfile(): check f_op.splice_write() rather than f_op.sendpage() 2011-03-02 09:46:40 -05:00
stack.c
stat.c Add unlocked version of inode_add_bytes() function 2010-01-06 15:05:01 -08:00
super.c vfs: get_sb_single() - do not pass options twice 2010-01-28 15:00:47 -08:00
sync.c fs/buffer.c: clean up EXPORT* macros 2009-09-23 07:39:29 -07:00
timerfd.c
utimes.c
xattr_acl.c
xattr.c