From: "Graf (AWS), Alexander" <graf@amazon.de>
To: Vu Nguyen Anh Khoa <khoavna.tin.2225@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: The AWS Nitro Enclaves Team <aws-nitro-enclaves-devel@amazon.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] misc: nsm: require CAP_SYS_ADMIN for raw ioctl
Date: Thu, 25 Jun 2026 22:23:01 +0000 [thread overview]
Message-ID: <047f64b2-4a0c-473a-9b32-eac2c3a01a38@amazon.com> (raw)
In-Reply-To: <d0d2be34-5b0e-4ff5-98b5-1d7fddb3882e@amazon.com>
On 21.06.26 11:33, Alexander Graf wrote:
>
> On 21.06.26 10:57, Vu Nguyen Anh Khoa wrote:
>> NSM_IOCTL_RAW lets userspace submit raw NSM messages. The UAPI
>> documents this ioctl as available only with CAP_SYS_ADMIN, but /dev/nsm
>> is registered with mode 0666 and nsm_dev_ioctl() does not enforce that
>> restriction.
>>
>> Reject unprivileged raw ioctl requests before accepting user-controlled
>> NSM messages.
>>
>> Signed-off-by: Vu Nguyen Anh Khoa <khoavna.tin.2225@gmail.com>
>
>
> This must have fallen through the cracks when I juggled with the
> different versions during initial submission. Nice catch!
>
> Reviewed-by: Alexander Graf <graf@amazon.com>
>
Actually, thinking a bit harder about it, I think this may break legit
use cases if you for example want to pass NSM access to a deprivileged
container namespace.
Greg, please drop this patch. It will break existing user space.
Vu, can you please instead patch the uapi header so it doesn't say "only
CAP_ADMIN"? That was a remnant of when the device had individual ioctls
for each command you could invoke, which turned out too ugly to pull
into the kernel. When reverting back to the "raw only" interface we have
today, I forgot to remove the CAP_ADMIN note.
Alex
Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christof Hellmis, Andreas Stieger
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
prev parent reply other threads:[~2026-06-25 22:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-21 8:57 Vu Nguyen Anh Khoa
2026-06-21 8:57 ` [PATCH 2/2] misc: nsm: do not unlock mutex before locking it Vu Nguyen Anh Khoa
2026-06-21 9:33 ` Graf (AWS), Alexander
2026-06-21 9:33 ` [PATCH 1/2] misc: nsm: require CAP_SYS_ADMIN for raw ioctl Graf (AWS), Alexander
2026-06-25 22:23 ` Graf (AWS), Alexander [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=047f64b2-4a0c-473a-9b32-eac2c3a01a38@amazon.com \
--to=graf@amazon.de \
--cc=arnd@arndb.de \
--cc=aws-nitro-enclaves-devel@amazon.com \
--cc=gregkh@linuxfoundation.org \
--cc=khoavna.tin.2225@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome