From: Ingo Molnar <mingo@elte.hu>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org, Randy Dunlap <rdunlap@xenotime.net>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Rik van Riel <riel@redhat.com>,
Federica Teodori <federica.teodori@googlemail.com>,
Lucian Adrian Grijincu <lucian.grijincu@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Eric Paris <eparis@redhat.com>,
Dan Rosenberg <drosenberg@vsecurity.com>,
linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org,
kernel-hardening@lists.openwall.com
Subject: Re: [PATCH v2011.2] fs: symlink restrictions on sticky directories
Date: Thu, 15 Dec 2011 07:48:17 +0100 [thread overview]
Message-ID: <20111215064817.GB14237@elte.hu> (raw)
In-Reply-To: <20111215004311.GA11049@www.outflux.net>
* Kees Cook <keescook@chromium.org> wrote:
> + /* Check parent directory mode and owner. */
> + spin_lock(&dentry->d_lock);
> + parent = dentry->d_parent->d_inode;
> + if ((parent->i_mode & (S_ISVTX|S_IWOTH)) == (S_ISVTX|S_IWOTH) &&
> + parent->i_uid != inode->i_uid) {
> + error = -EACCES;
> + }
> + spin_unlock(&dentry->d_lock);
> +
> +#ifdef CONFIG_AUDIT
> + if (error) {
> + struct audit_buffer *ab;
> +
> + ab = audit_log_start(current->audit_context,
> + GFP_ATOMIC, AUDIT_AVC);
> + audit_log_format(ab, "op=follow_link action=denied");
> + audit_log_d_path(ab, "path=", &nameidata->path);
> + audit_log_format(ab, " name=");
> + audit_log_untrustedstring(ab, dentry->d_name.name);
> + audit_log_format(ab, " dev=%s ino=%lu",
> + inode->i_sb->s_id,
> + inode->i_ino);
> + audit_log_end(ab);
> + }
> +#endif
Hm, is GFP_ATOMIC really necessary here? Why not GFP_KERNEL?
This is in VFS process context, not in some atomic context that
has to be careful about allocations, right?
Thanks,
Ingo
next prev parent reply other threads:[~2011-12-15 6:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 0:43 [PATCH v2011.2] fs: symlink restrictions on sticky directories Kees Cook
2011-12-15 1:14 ` [PATCH v2011.3] " Kees Cook
2011-12-15 6:48 ` Ingo Molnar [this message]
2011-12-15 7:06 ` [PATCH v2011.2] " Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111215064817.GB14237@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=drosenberg@vsecurity.com \
--cc=eparis@redhat.com \
--cc=federica.teodori@googlemail.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucian.grijincu@gmail.com \
--cc=rdunlap@xenotime.net \
--cc=riel@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).