Re: [PATCH v3 2/2] fs/xattr: add *at family syscalls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: cgzones@xxxxxxxxxxxxxx
- Subject: Re: [PATCH v3 2/2] fs/xattr: add *at family syscalls
- From: "Arnd Bergmann" <arnd@xxxxxxxx>
- Date: Fri, 26 Apr 2024 19:38:18 +0200
- Cc: x86@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, audit@xxxxxxxxxxxxxxx, Linux-Arch <linux-arch@xxxxxxxxxxxxxxx>, linux-api@xxxxxxxxxxxxxxx, linux-security-module@xxxxxxxxxxxxxxx, selinux@xxxxxxxxxxxxxxx, "Richard Henderson" <richard.henderson@xxxxxxxxxx>, "Ivan Kokshaysky" <ink@xxxxxxxxxxxxxxxxxxxx>, "Matt Turner" <mattst88@xxxxxxxxx>, "Russell King" <linux@xxxxxxxxxxxxxxx>, "Catalin Marinas" <catalin.marinas@xxxxxxx>, "Will Deacon" <will@xxxxxxxxxx>, "Geert Uytterhoeven" <geert@xxxxxxxxxxxxxx>, "Michal Simek" <monstr@xxxxxxxxx>, "Thomas Bogendoerfer" <tsbogend@xxxxxxxxxxxxxxxx>, "James E . J . Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, "Helge Deller" <deller@xxxxxx>, "Michael Ellerman" <mpe@xxxxxxxxxxxxxx>, "Nicholas Piggin" <npiggin@xxxxxxxxx>, "Christophe Leroy" <christophe.leroy@xxxxxxxxxx>, "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxx>, "Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxx>, "Heiko Carstens" <hca@xxxxxxxxxxxxx>, "Vasily Gorbik" <gor@xxxxxxxxxxxxx>, "Alexander Gordeev" <agordeev@xxxxxxxxxxxxx>, "Christian Borntraeger" <borntraeger@xxxxxxxxxxxxx>, "Sven Schnelle" <svens@xxxxxxxxxxxxx>, "Yoshinori Sato" <ysato@xxxxxxxxxxxxx>, "Rich Felker" <dalias@xxxxxxxx>, "John Paul Adrian Glaubitz" <glaubitz@xxxxxxxxxxxxxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, "Andreas Larsson" <andreas@xxxxxxxxxxx>, "Andy Lutomirski" <luto@xxxxxxxxxx>, "Thomas Gleixner" <tglx@xxxxxxxxxxxxx>, "Ingo Molnar" <mingo@xxxxxxxxxx>, "Borislav Petkov" <bp@xxxxxxxxx>, "Dave Hansen" <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, "Chris Zankel" <chris@xxxxxxxxxx>, "Max Filippov" <jcmvbkbc@xxxxxxxxx>, "Alexander Viro" <viro@xxxxxxxxxxxxxxxxxx>, "Christian Brauner" <brauner@xxxxxxxxxx>, "Jan Kara" <jack@xxxxxxx>, "Paul Moore" <paul@xxxxxxxxxxxxxx>, "Eric Paris" <eparis@xxxxxxxxxx>, "Jens Axboe" <axboe@xxxxxxxxx>, "Pavel Begunkov" <asml.silence@xxxxxxxxx>, "Peter Zijlstra" <peterz@xxxxxxxxxxxxx>, "Sohil Mehta" <sohil.mehta@xxxxxxxxx>, "Palmer Dabbelt" <palmer@xxxxxxxxxx>, "Miklos Szeredi" <mszeredi@xxxxxxxxxx>, "Nhat Pham" <nphamcs@xxxxxxxxx>, "Casey Schaufler" <casey@xxxxxxxxxxxxxxxx>, "Florian Fainelli" <florian.fainelli@xxxxxxxxxxxx>, "Kees Cook" <keescook@xxxxxxxxxxxx>, "Rick Edgecombe" <rick.p.edgecombe@xxxxxxxxx>, "Mark Rutland" <mark.rutland@xxxxxxx>, io-uring@xxxxxxxxxxxxxxx
- Feedback-id: i56a14606:Fastmail
- In-reply-to: <20240426162042.191916-1-cgoettsche@seltendoof.de>
- References: <20240426162042.191916-1-cgoettsche@seltendoof.de>
- User-agent: Cyrus-JMAP/3.11.0-alpha0-386-g4cb8e397f9-fm-20240415.001-g4cb8e397
On Fri, Apr 26, 2024, at 18:20, Christian Göttsche wrote:
> From: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
>
> Add the four syscalls setxattrat(), getxattrat(), listxattrat() and
> removexattrat(). Those can be used to operate on extended attributes,
> especially security related ones, either relative to a pinned directory
> or on a file descriptor without read access, avoiding a
> /proc/<pid>/fd/<fd> detour, requiring a mounted procfs.
>
> One use case will be setfiles(8) setting SELinux file contexts
> ("security.selinux") without race conditions and without a file
> descriptor opened with read access requiring SELinux read permission.
>
> Use the do_{name}at() pattern from fs/open.c.
>
> Pass the value of the extended attribute, its length, and for
> setxattrat(2) the command (XATTR_CREATE or XATTR_REPLACE) via an added
> struct xattr_args to not exceed six syscall arguments and not
> merging the AT_* and XATTR_* flags.
>
> Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
> CC: x86@xxxxxxxxxx
> CC: linux-alpha@xxxxxxxxxxxxxxx
> CC: linux-kernel@xxxxxxxxxxxxxxx
> CC: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> CC: linux-ia64@xxxxxxxxxxxxxxx
> CC: linux-m68k@xxxxxxxxxxxxxxxxxxxx
> CC: linux-mips@xxxxxxxxxxxxxxx
> CC: linux-parisc@xxxxxxxxxxxxxxx
> CC: linuxppc-dev@xxxxxxxxxxxxxxxx
> CC: linux-s390@xxxxxxxxxxxxxxx
> CC: linux-sh@xxxxxxxxxxxxxxx
> CC: sparclinux@xxxxxxxxxxxxxxx
> CC: linux-fsdevel@xxxxxxxxxxxxxxx
> CC: audit@xxxxxxxxxxxxxxx
> CC: linux-arch@xxxxxxxxxxxxxxx
> CC: linux-api@xxxxxxxxxxxxxxx
> CC: linux-security-module@xxxxxxxxxxxxxxx
> CC: selinux@xxxxxxxxxxxxxxx
I checked that the syscalls are all well-formed regarding
argument types, number of arguments and (absence of)
compat handling, and that they are wired up correctly
across architectures
I did not look at the actual implementation in detail.
Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]