lkml.org 
[lkml]   [2012]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] c/r: prctl: Add ability to set new mm_struct::exe_file v3
On Thu, Mar 08, 2012 at 11:31:58AM -0800, Kees Cook wrote:
...
> > +       err = -EACCES;
> > +       if (!S_ISREG(dentry->d_inode->i_mode)   ||
> > +           exe_file->f_path.mnt->mnt_flags & MNT_NOEXEC)
> > +               goto exit;
>
> I'm starting to notice that this pattern (testing ISREG and
> MNT_NOEXEC) is getting repeated a few times in the kernel, and at
> least the no-new-privs patch (not yet in -mm but hopefully soon given
> the seccomp_filter work) updates this pattern everywhere. Perhaps this
> should be extracted into a helper first, and then this patch can call
> that helper here? (And then nnp can just update the single helper.)
>

I can do that if Andrew agree.

Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-08 20:43    [W:0.086 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site