From 8f38f4dc22f65415ffbc3055ec9c308f2f4d6fc8 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Tue, 16 Oct 2007 23:31:14 -0700 Subject: [PATCH] --- yaml --- r: 70773 b: refs/heads/master c: c7eb26678e59f16f4e84f1176d187cd21a27414d h: refs/heads/master i: 70771: 768665624816d362f4bbfce1a849427dfea34cb9 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index f80304f97309..7ad99636b254 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b41572e929221b0d87f529106cdf12185ee84bca +refs/heads/master: c7eb26678e59f16f4e84f1176d187cd21a27414d diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index a29bb0f40ed5..464eeccb675b 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -228,6 +228,10 @@ int generic_permission(struct inode *inode, int mask, int permission(struct inode *inode, int mask, struct nameidata *nd) { int retval, submask; + struct vfsmount *mnt = NULL; + + if (nd) + mnt = nd->mnt; if (mask & MAY_WRITE) { umode_t mode = inode->i_mode; @@ -251,7 +255,7 @@ int permission(struct inode *inode, int mask, struct nameidata *nd) * MAY_EXEC on regular files is denied if the fs is mounted * with the "noexec" flag. */ - if (nd && nd->mnt && (nd->mnt->mnt_flags & MNT_NOEXEC)) + if (mnt && (mnt->mnt_flags & MNT_NOEXEC)) return -EACCES; }