All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Greg KH <greg@kroah.com>, Andy Lutomirski <luto@kernel.org>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
	stable@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	linux-kselftest@vger.kernel.org,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] selftests/capabilities: Fix the test_execve test
Date: Thu, 29 Jun 2017 14:41:17 -0600	[thread overview]
Message-ID: <47055265-ebca-55e4-a0ac-92aa06c92dd3@osg.samsung.com> (raw)
In-Reply-To: <20170629165506.GA10065@kroah.com>

On 06/29/2017 10:55 AM, Greg KH wrote:
> On Thu, Jun 29, 2017 at 08:46:12AM -0700, Andy Lutomirski wrote:
>> test_execve does rather odd mount manipulations to safely create
>> temporary setuid and setgid executables that aren't visible to the
>> rest of the system.  Those executables end up in the test's cwd, but
>> that cwd is MNT_DETACHed.
>>
>> The core namespace code considers MNT_DETACHed trees to belong to no
>> mount namespace at all and, in general, MNT_DETACHed trees are only
>> barely function.  This interacted with commit 380cf5ba6b0a ("fs:
>> Treat foreign mounts as nosuid") to cause all MNT_DETACHed trees to
>> act as though they're nosuid, breaking the test.
>>
>> Fix it by just not detaching the tree.  It's still in a private
>> mount namespace and is therefore still invisible to the rest of the
>> system (except via /proc, and the same nosuid logic will protect all
>> other programs on the system from believing in test_execve's setuid
>> bits).
>>
>> While we're at it, fix some blatant whitespace problems.
>>
>> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
>> Fixes: 380cf5ba6b0a ("fs: Treat foreign mounts as nosuid")
>> Cc: stable@vger.kernel.org
>> Cc: "Eric W. Biederman" <ebiederm@xmission.com>
>> Cc: Kees Cook <keescook@chromium.org>
>> Cc: Shuah Khan <shuahkh@osg.samsung.com>
>> Cc: Greg KH <greg@kroah.com>
>> Cc: linux-kselftest@vger.kernel.org
>> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> 
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Thanks for fixing this!
> 

Thanks Andy for the fix. It is now in linux-kselftest next for 4.13-rc1

-- Shuah

      reply	other threads:[~2017-06-29 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 15:46 [PATCH] selftests/capabilities: Fix the test_execve test Andy Lutomirski
2017-06-29 16:32 ` Eric W. Biederman
2017-06-29 16:55 ` Greg KH
2017-06-29 20:41   ` Shuah Khan [this message]

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=47055265-ebca-55e4-a0ac-92aa06c92dd3@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.com \
    --cc=keescook@chromium.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.