From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Pavel Emelyanov <xemul@parallels.com>,
Kees Cook <keescook@chromium.org>, Tejun Heo <tj@kernel.org>,
Matt Helsley <matthltc@us.ibm.com>
Subject: Re: [patch 1/2] c/r: prctl: Add ability to set new mm_struct::exe_file
Date: Tue, 20 Mar 2012 02:39:41 +0400 [thread overview]
Message-ID: <20120319223941.GJ19594@moon> (raw)
In-Reply-To: <20120319151507.93bab32a.akpm@linux-foundation.org>
On Mon, Mar 19, 2012 at 03:15:07PM -0700, Andrew Morton wrote:
...
> >
> > Also this action is one-shot only. For security reason
> > we don't allow to change the symlink several times.
>
> What is this mysterious "security reason"?
>
Oh, sorry I should have included Matt's comment here
| Before this patch that state was rather ephemeral and almost entirely
| under the control of the kernel. The only way userspace could change it
| was by unmapping the region(s) mapped during exec*(). At that point it
| could not "lie" and insert some other symlink there and the admin would
| be better able to determine what had happened.
|
| With this patch -- especially the multi-shot form -- the symlink will
| be entirely under the control of (potentially untrusted) userspace code
| and the admin is totally at the mercy of the userspace code. In
| single-shot form programs could use the prctl() to ensure the symlink
| could not be changed later -- the restart tool would be the only program
| that would need to ensure that prctl() had not been used since the last
| exec*().
...
>
> It should be explained here also. The comment is pretty useless - if
> we don't tell people what this "security reason" is, how can future
> developers be sure that they aren't violating it?
>
Actually I liked multi-shot version more but Matt arguments convinced
me that one-short fashion is more "secure" in terms of overall kernel
state and potential transitions/changes of this /proc/pid/exe symlink.
At least with one-shot version the admin may be sure that the symlink
is never changed more than once, ever.
Cyrill
next prev parent reply other threads:[~2012-03-19 22:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 20:55 [patch 0/2] [PATCH 0/2] prctl extension in a sake of c/r Cyrill Gorcunov
2012-03-16 20:55 ` [patch 1/2] c/r: prctl: Add ability to set new mm_struct::exe_file Cyrill Gorcunov
2012-03-19 22:15 ` Andrew Morton
2012-03-19 22:39 ` Cyrill Gorcunov [this message]
2012-03-19 22:41 ` richard -rw- weinberger
2012-03-19 22:46 ` Andrew Morton
2012-03-19 22:50 ` Cyrill Gorcunov
2012-03-19 22:59 ` Andrew Morton
2012-03-19 23:12 ` Cyrill Gorcunov
2012-03-19 23:02 ` richard -rw- weinberger
2012-03-19 23:17 ` Cyrill Gorcunov
2012-03-19 23:23 ` richard -rw- weinberger
2012-03-20 6:55 ` Cyrill Gorcunov
2012-03-22 23:38 ` Eric W. Biederman
2012-03-23 6:41 ` Cyrill Gorcunov
2012-03-23 6:47 ` Cyrill Gorcunov
2012-03-23 17:06 ` Matt Helsley
2012-03-19 22:47 ` Cyrill Gorcunov
2012-03-16 20:55 ` [patch 2/2] c/r: prctl: Add ability to get clear_tid_address Cyrill Gorcunov
2012-03-19 16:51 ` Kees Cook
2012-03-19 16:55 ` Cyrill Gorcunov
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=20120319223941.GJ19594@moon \
--to=gorcunov@openvz.org \
--cc=akpm@linux-foundation.org \
--cc=keescook@chromium.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthltc@us.ibm.com \
--cc=oleg@redhat.com \
--cc=tj@kernel.org \
--cc=xemul@parallels.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