From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Randy Dunlap <rdunlap@xenotime.net>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Ingo Molnar <mingo@elte.hu>,
linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org,
kernel-hardening@lists.openwall.com
Subject: Re: [PATCH] fs: hardlink creation restrictions
Date: Sat, 18 Feb 2012 21:56:26 +0100 [thread overview]
Message-ID: <20120218205626.GA26880@joi.lan> (raw)
In-Reply-To: <20120218193857.GA30985@www.outflux.net>
On Sat, Feb 18, 2012 at 11:38:57AM -0800, Kees Cook wrote:
> @@ -3052,6 +3119,9 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
> error = mnt_want_write(new_path.mnt);
> if (error)
> goto out_dput;
> + error = may_linkat(&old_path);
> + if (error)
> + goto out_dput;
> error = security_path_link(old_path.dentry, &new_path, new_dentry);
> if (error)
> goto out_drop_write;
You should give up write access after check failure (i.e. goto out_drop_write).
Marcin
next prev parent reply other threads:[~2012-02-18 20:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-18 19:38 [PATCH] fs: hardlink creation restrictions Kees Cook
2012-02-18 20:56 ` Marcin Slusarz [this message]
2012-02-19 1:36 ` Kees Cook
2012-02-19 12:49 ` Ingo Molnar
2012-02-19 17:45 ` Kees Cook
2012-02-20 8:22 ` Ingo Molnar
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=20120218205626.GA26880@joi.lan \
--to=marcin.slusarz@gmail.com \
--cc=akpm@linux-foundation.org \
--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=mingo@elte.hu \
--cc=rdunlap@xenotime.net \
--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).