diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-25 08:57:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-03-25 08:57:47 -0700 |
commit | 7ed7fe5e82c9fc8473974fbd7389d169b8f17c77 (patch) | |
tree | ff6ff57c88c887133f1585473e7d74981d0dc88c /fs/open.c | |
parent | a4083c9271e0a697278e089f2c0b9a95363ada0a (diff) | |
parent | a02f76c34d7d6d30b63ac64a8b34dea68593e8da (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
[PATCH] get stack footprint of pathname resolution back to relative sanity
[PATCH] double iput() on failure exit in hugetlb
[PATCH] double dput() on failure exit in tiny-shmem
[PATCH] fix up new filp allocators
[PATCH] check for null vfsmount in dentry_open()
[PATCH] reiserfs: eliminate private use of struct file in xattr
[PATCH] sanitize hppfs
hppfs pass vfsmount to dentry_open()
[PATCH] restore export of do_kern_mount()
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/open.c b/fs/open.c index 54198538b67..a4b12022eda 100644 --- a/fs/open.c +++ b/fs/open.c @@ -903,6 +903,18 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags) int error; struct file *f; + /* + * We must always pass in a valid mount pointer. Historically + * callers got away with not passing it, but we must enforce this at + * the earliest possible point now to avoid strange problems deep in the + * filesystem stack. + */ + if (!mnt) { + printk(KERN_WARNING "%s called with NULL vfsmount\n", __func__); + dump_stack(); + return ERR_PTR(-EINVAL); + } + error = -ENFILE; f = get_empty_filp(); if (f == NULL) { |