From: swarup <swarupkotikalapudi@gmail.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] selftests: capabilities: namespace create varies for root and normal user
Date: Sat, 11 Nov 2023 22:23:38 +0530 [thread overview]
Message-ID: <ZU+xkpH09xjzO5IS@swarup-virtual-machine> (raw)
In-Reply-To: <0f3a63ff-cbf9-4e06-8f4f-fd22bafa26fe@linuxfoundation.org>
On Tue, Nov 07, 2023 at 02:23:34PM -0700, Shuah Khan wrote:
> On 9/29/23 06:53, Swarup Laxman Kotiaklapudi wrote:
> > Change namespace creation for root and non-root
> > user differently in create_and_enter_ns() function
> >
>
> Sorry for the delay on reviewing this.
>
> Can you tell me more about why this change is needed and
> include it in the change log.
>
> thanks,
> -- Shuah
Hi Shuah,
This patchset was raised to fix below TODO:
"If we're already root, we could skip creating the userns."
Without this patchset, function create_and_enter_ns(),
at this path --> tools/testing/selftests/capabilities/test_execve.c
was as mentioned below:
static bool create_and_enter_ns(uid_t inner_uid)
{
....
if (unshare(CLONE_NEWNS) == 0) {
....
} else if (unshare(CLONE_NEWUSER | CLONE_NEWNS) == 0) {
....
} else {
ksft_exit_skip("must be root or be able to create a userns\n");
}
...
}
To fix the TODO, above mentioned if block is executed if root user,
for normal user it enters inside 'else if' block.
Thanks,
Swarup
next prev parent reply other threads:[~2023-11-11 16:53 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 [this message]
2023-11-11 17:38 ` [PATCH v2] " Swarup Laxman Kotiaklapudi
2023-11-30 23:38 ` Shuah Khan
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=ZU+xkpH09xjzO5IS@swarup-virtual-machine \
--to=swarupkotikalapudi@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.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 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).