4 Jul 2012 11:32
[PATCH] vfs: check value of varaiable 'nd' before using its member
Robin Dong <robin.k.dong <at> gmail.com>
2012-07-04 09:32:44 GMT
2012-07-04 09:32:44 GMT
From: Robin Dong <sanbai <at> taobao.com> When we using lookup_one_len() to search pathname component, it will call __lookup_hash() with variable 'nd' as NULL : --> __lookup_hash ( nd = NULL ) --> lookup_dcache --> d_invalidate --> proc_sys_revalidate the proc_sys_revalidate will use 'nd->flags' before check whether its value is NULL. This will cause kernel panic. Therefore, we should adding check-code for filesystems which directly use nd->flags. Signed-off-by: Robin Dong <sanbai <at> taobao.com> --- fs/9p/vfs_dentry.c | 2 +- fs/afs/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/hfs/sysdep.c | 2 +- fs/ncpfs/dir.c | 2 +- fs/nfs/dir.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/sysfs/dir.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c index d529437..2785900 100644 --- a/fs/9p/vfs_dentry.c(Continue reading)
RSS Feed