kernel_optimize_test/fs
Eric Sandeen d6ddf55440 [PATCH] hfs_fill_super returns success even if no root inode
http://kernelfun.blogspot.com/2006/11/mokb-14-11-2006-linux-26x-selinux.html

mount that image...
fs: filesystem was not cleanly unmounted, running fsck.hfs is recommended.  mounting read-only.
hfs: get root inode failed.
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000018
 printing eip
...
EIP is at superblock_doinit+0x21/0x767
...
 [] selinux_sb_kern_mount+0xc/0x4b
 [] vfs_kern_mount+0x99/0xf6
 [] do_kern_mount+0x2d/0x3e
 [] do_mount+0x5fa/0x66d
 [] sys_mount+0x77/0xae
 [] syscall_call+0x7/0xb
DWARF2 unwinder stuck at syscall_call+0x7/0xb

hfs_fill_super() returns success even if
  root_inode = hfs_iget(sb, &fd.search_key->cat, &rec);
or
  sb->s_root = d_alloc_root(root_inode);

fails.  This superblock finds its way to superblock_doinit() which does:

        struct dentry *root = sb->s_root;
        struct inode *inode = root->d_inode;

and boom.  Need to make sure the error cases return an error, I think.

[akpm@osdl.org: return -ENOMEM on oom]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-16 11:43:38 -08:00
..
9p
adfs
affs
afs
autofs [PATCH] autofs4: panic after mount fail 2006-11-14 09:09:27 -08:00
autofs4 [PATCH] autofs4: panic after mount fail 2006-11-14 09:09:27 -08:00
befs
bfs
cifs [CIFS] Fix minor problem with previous patch 2006-11-09 21:25:37 +00:00
coda
configfs
cramfs
debugfs
devpts
dlm [DLM] fix oops in kref_put when removing a lockspace 2006-11-06 09:28:01 -05:00
ecryptfs [PATCH] eCryptfs: dput() lower d_parent on rename 2006-11-16 11:43:37 -08:00
efs
exportfs
ext2
ext3
ext4 [PATCH] ext4: fix printk format warnings 2006-10-28 11:30:51 -07:00
fat
freevxfs
fuse [PATCH] fuse: ->readpages() cleanup 2006-11-03 12:27:57 -08:00
gfs2 [GFS2] Fix OOM error handling 2006-11-06 08:59:42 -05:00
hfs [PATCH] hfs_fill_super returns success even if no root inode 2006-11-16 11:43:38 -08:00
hfsplus
hostfs
hpfs
hppfs
hugetlbfs [PATCH] hugetlb: prepare_hugepage_range check offset too 2006-11-14 09:09:27 -08:00
isofs
jbd [PATCH] jbd: journal_dirty_data re-check for unmapped buffers 2006-10-28 11:30:51 -07:00
jbd2 [PATCH] jbd2: journal_dirty_data re-check for unmapped buffers 2006-10-28 11:30:51 -07:00
jffs
jffs2
jfs JFS: Remove redundant xattr permission checking 2006-11-02 10:50:40 -06:00
lockd [PATCH] sysctl: implement CTL_UNNUMBERED 2006-11-06 01:46:23 -08:00
minix
msdos
ncpfs
nfs [PATCH] sysctl: implement CTL_UNNUMBERED 2006-11-06 01:46:23 -08:00
nfs_common
nfsd [PATCH] nfsd: fix spurious error return from nfsd_create in async case 2006-11-08 18:29:25 -08:00
nls
ntfs
ocfs2
openpromfs
partitions
proc
qnx4
ramfs
reiserfs [PATCH] reiserfs: reset errval after initializing bitmap cache 2006-11-03 12:27:58 -08:00
romfs
smbfs
sysfs
sysv
udf
ufs
vfat
xfs [XFS] Remove KERNEL_VERSION macros from xfs_dmapi.h 2006-11-11 18:05:06 +11:00
aio.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c
block_dev.c [PATCH] find_bd_holder() fix 2006-10-31 08:06:58 -08:00
buffer.c
char_dev.c
compat_ioctl.c
compat.c [PATCH] sys_pselect7 vs compat_sys_pselect7 uaccess error handling 2006-11-03 12:27:55 -08:00
dcache.c [PATCH] VFS: Fix an error in unused dentry counting 2006-10-28 11:30:53 -07:00
dcookies.c
direct-io.c
dnotify.c
dquot.c
drop_caches.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file_table.c
file.c
filesystems.c
fs-writeback.c
generic_acl.c
inode.c
inotify_user.c
inotify.c
internal.h
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
quota_v1.c
quota_v2.c
quota.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
splice.c [PATCH] splice: fix problem introduced with inode diet 2006-11-04 08:45:39 -08:00
stat.c
super.c
sync.c
utimes.c
xattr_acl.c
xattr.c [PATCH] Fix user.* xattr permission check for sticky dirs 2006-11-03 12:27:59 -08:00