From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Kees Cook <kees.cook@canonical.com>
Cc: linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org,
Randy Dunlap <rdunlap@xenotime.net>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Kosina <jkosina@suse.cz>,
Dave Young <hidave.darkstar@gmail.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
James Morris <jmorris@namei.org>, Eric Paris <eparis@redhat.com>,
David Howells <dhowells@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Tim Gardner <tim.gardner@canonical.com>
Subject: Re: [PATCH] fs: block cross-uid sticky symlinks
Date: Thu, 27 May 2010 23:40:26 -0500 [thread overview]
Message-ID: <20100528044026.GA13636@us.ibm.com> (raw)
In-Reply-To: <20100527201635.GU6056@outflux.net>
Quoting Kees Cook (kees.cook@canonical.com):
> A long-standing class of security issues is the symlink-based
> time-of-check-time-of-use race, most commonly seen in world-writable
> directories like /tmp. The common method of exploitation of this flaw
> is to cross privilege boundaries when following a given symlink (i.e. a
> root process follows a symlink belonging to another user). For a likely
> incomplete list of hundreds of examples across the years, please see:
> http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=/tmp
That is quite a list :)
> +int cap_inode_follow_link(struct dentry *dentry,
> + struct nameidata *nameidata)
> +{
> + const struct inode *parent = dentry->d_parent->d_inode;
> + const struct inode *inode = dentry->d_inode;
> + const struct cred *cred = current_cred();
> +
> + if (weak_sticky_symlinks)
> + return 0;
> +
> + if (S_ISLNK(inode->i_mode) &&
Q: is the S_ISLNK() check actually needed?
In either case:
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
thanks,
-serge
next prev parent reply other threads:[~2010-05-28 4:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 20:16 [PATCH] fs: block cross-uid sticky symlinks Kees Cook
2010-05-28 4:40 ` Serge E. Hallyn [this message]
2010-05-28 18:39 ` Kees Cook
2010-05-28 6:10 ` Dave Young
2010-05-28 18:39 ` 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=20100528044026.GA13636@us.ibm.com \
--to=serue@us.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=eparis@redhat.com \
--cc=hidave.darkstar@gmail.com \
--cc=jkosina@suse.cz \
--cc=jmorris@namei.org \
--cc=kees.cook@canonical.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rdunlap@xenotime.net \
--cc=schwidefsky@de.ibm.com \
--cc=tim.gardner@canonical.com \
/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).