Linux Kernel Mentees Archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Swarup Laxman Kotiaklapudi <swarupkotikalapudi@gmail.com>,
	shuah@kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org, luto@kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] selftests: capabilities: namespace create varies for root and normal user
Date: Thu, 30 Nov 2023 16:38:42 -0700	[thread overview]
Message-ID: <7900802c-3860-4a52-aede-edc544461a57@linuxfoundation.org> (raw)
In-Reply-To: <20231111173806.16775-1-swarupkotikalapudi@gmail.com>

On 11/11/23 10:38, Swarup Laxman Kotiaklapudi wrote:
> This patchset fixes TODO:
> "If we're already root, we could skip creating the userns."
> 
> Change namespace creation for root and non-root
> user differently in create_and_enter_ns() function
> in this file:
> tools/testing/selftests/capabilities/test_execve.c
> 
> Test result with root user:
> $sudo make  TARGETS="capabilities" kselftest
>   ...
>   TAP version 13
>   1..1
>   timeout set to 45
>   selftests: capabilities: test_execve
>   TAP version 13
>   1..12
>   [RUN]       +++ Tests with uid == 0 +++
>   [NOTE]      Using global UIDs for tests
>   [RUN]       Root => ep
>   ...
>   ok 12 Passed
>   Totals: pass:12 fail:0 xfail:0 xpass:0 skip:0 error:0
>   ==================================================
>   TAP version 13
>   1..9
>   [RUN]       +++ Tests with uid != 0 +++
>   [NOTE]      Using global UIDs for tests
>   [RUN]       Non-root => no caps
>   ...
>   ok 9 Passed
>   Totals: pass:9 fail:0 xfail:0 xpass:0 skip:0 error:0
> 
> Test result without root or normal user:
> $make  TARGETS="capabilities" kselftest
>   ...
>   timeout set to 45
>   selftests: capabilities: test_execve
>   TAP version 13
>   1..12
>   [RUN]       +++ Tests with uid == 0 +++
>   [NOTE]      Using a user namespace for tests
>   [RUN]       Root => ep
>   validate_cap:: Capabilities after execve were correct
>   ok 1 Passed
>   Check cap_ambient manipulation rules
>   ok 2 PR_CAP_AMBIENT_RAISE failed on non-inheritable cap
>   ok 3 PR_CAP_AMBIENT_RAISE failed on non-permitted cap
>   ok 4 PR_CAP_AMBIENT_RAISE worked
>   ok 5 Basic manipulation appears to work
>   [RUN]       Root +i => eip
>   validate_cap:: Capabilities after execve were correct
>   ok 6 Passed
>   [RUN]       UID 0 +ia => eipa
>   validate_cap:: Capabilities after execve were correct
>   ok 7 Passed
>   ok 8 # SKIP SUID/SGID tests (needs privilege)
>   Planned tests != run tests (12 != 8)
>   Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0
>   ==================================================
>   TAP version 13
>   1..9
>   [RUN]       +++ Tests with uid != 0 +++
>   [NOTE]      Using a user namespace for tests
>   [RUN]       Non-root => no caps
>   validate_cap:: Capabilities after execve were correct
>   ok 1 Passed
>   Check cap_ambient manipulation rules
>   ok 2 PR_CAP_AMBIENT_RAISE failed on non-inheritable cap
>   ok 3 PR_CAP_AMBIENT_RAISE failed on non-permitted cap
>   ok 4 PR_CAP_AMBIENT_RAISE worked
>   ok 5 Basic manipulation appears to work
>   [RUN]       Non-root +i => i
>   validate_cap:: Capabilities after execve were correct
>   ok 6 Passed
>   [RUN]       UID 1 +ia => eipa
>   validate_cap:: Capabilities after execve were correct
>   ok 7 Passed
>   ok 8 # SKIP SUID/SGID tests (needs privilege)
>   Planned tests != run tests (9 != 8)
>   Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0
> 
> Signed-off-by: Swarup Laxman Kotiaklapudi <swarupkotikalapudi@gmail.com>
> ---
> 
> Changes in V2:
>   - Change the commit message explaining
>     why this patchset is needed.
> 

Applied to linux-kselftest next for Linux 6.8-rc1

thanks,
-- Shuah


      reply	other threads:[~2023-11-30 23:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 12:53 [PATCH] selftests: capabilities: namespace create varies for root and normal user Swarup Laxman Kotiaklapudi
2023-10-19 18:39 ` swarup
2023-11-07 21:23 ` Shuah Khan
2023-11-11 16:53   ` swarup
2023-11-11 17:38     ` [PATCH v2] " Swarup Laxman Kotiaklapudi
2023-11-30 23:38       ` 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=7900802c-3860-4a52-aede-edc544461a57@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=shuah@kernel.org \
    --cc=swarupkotikalapudi@gmail.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 read-only IMAP folder(s) and NNTP newsgroup(s).