Re: [PATCH v4 3/3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-04-28 Thread Christian Brauner
On Fri, Apr 25, 2025 at 08:16:48PM +0200, Andrey Albershteyn wrote: > On 2025-04-22 17:14:10, Christian Brauner wrote: > > On Tue, Apr 22, 2025 at 04:31:29PM +0200, Christian Brauner wrote: > > > On Thu, Mar 27, 2025 at 12:39:28PM +0100, Amir Goldstein wrote: > > > &

Re: [PATCH v4 3/3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-04-24 Thread Christian Brauner
On Wed, Apr 23, 2025 at 11:53:25AM +0200, Jan Kara wrote: > On Tue 22-04-25 16:59:02, Christian Brauner wrote: > > On Fri, Mar 21, 2025 at 08:48:42PM +0100, Andrey Albershteyn wrote: > > > From: Andrey Albershteyn > > > > > > Introduce getfsxattrat and setfs

Re: [PATCH v4 3/3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-04-22 Thread Christian Brauner
On Tue, Apr 22, 2025 at 04:31:29PM +0200, Christian Brauner wrote: > On Thu, Mar 27, 2025 at 12:39:28PM +0100, Amir Goldstein wrote: > > On Thu, Mar 27, 2025 at 10:33 AM Andrey Albershteyn > > wrote: > > > > > > On 2025-03-23 09:56:25, Amir Goldstein wrote:

Re: [PATCH v4 3/3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-04-22 Thread Christian Brauner
On Fri, Mar 21, 2025 at 08:48:42PM +0100, Andrey Albershteyn wrote: > From: Andrey Albershteyn > > Introduce getfsxattrat and setfsxattrat syscalls to manipulate inode > extended attributes/flags. The syscalls take parent directory fd and > path to the child together with struct fsxattr. > > Thi

Re: [PATCH v4 3/3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-04-22 Thread Christian Brauner
On Thu, Mar 27, 2025 at 12:39:28PM +0100, Amir Goldstein wrote: > On Thu, Mar 27, 2025 at 10:33 AM Andrey Albershteyn > wrote: > > > > On 2025-03-23 09:56:25, Amir Goldstein wrote: > > > On Fri, Mar 21, 2025 at 8:49 PM Andrey Albershteyn > > > wrote: > > > > > > > > From: Andrey Albershteyn >

Re: [PATCH 1/4] spufs: fix a leak on spufs_new_file() failure

2025-03-13 Thread Christian Brauner
be explicitly dropped. > > Fixes: 3f51dd91c807 "[PATCH] spufs: fix spufs_fill_dir error path" > Signed-off-by: Al Viro > --- Reviewed-by: Christian Brauner

Re: [PATCH 3/4] spufs: fix a leak in spufs_create_context()

2025-03-13 Thread Christian Brauner
" > Signed-off-by: Al Viro > --- Reviewed-by: Christian Brauner

Re: [PATCH 2/4] spufs: fix gang directory lifetimes

2025-03-13 Thread Christian Brauner
rovided that it's not 0. > * using simple_recursive_removal() to take the gang > directory out when counter reaches zero. > > Fixes: 877907d37da9 "[POWERPC] spufs: Fix gang destroy leaks" > Signed-off-by: Al Viro > --- Reviewed-by: Christian Brauner

Re: [PATCH v3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-02-25 Thread Christian Brauner
On Tue, Feb 25, 2025 at 11:40:51AM +0100, Arnd Bergmann wrote: > On Tue, Feb 25, 2025, at 11:22, Christian Brauner wrote: > > On Tue, Feb 25, 2025 at 09:02:04AM +0100, Arnd Bergmann wrote: > >> On Mon, Feb 24, 2025, at 12:32, Christian Brauner wrote: > >> > >&g

Re: [PATCH v3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-02-25 Thread Christian Brauner
On Tue, Feb 25, 2025 at 09:02:04AM +0100, Arnd Bergmann wrote: > On Mon, Feb 24, 2025, at 12:32, Christian Brauner wrote: > > On Fri, Feb 21, 2025 at 08:15:24PM +0100, Amir Goldstein wrote: > >> On Fri, Feb 21, 2025 at 7:13 PM Darrick J. Wong wrote: > &g

Re: [PATCH v3] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-02-24 Thread Christian Brauner
On Fri, Feb 21, 2025 at 08:15:24PM +0100, Amir Goldstein wrote: > On Fri, Feb 21, 2025 at 7:13 PM Darrick J. Wong wrote: > > > > On Tue, Feb 11, 2025 at 06:22:47PM +0100, Andrey Albershteyn wrote: > > > From: Andrey Albershteyn > > > > > > Introduce getfsxattrat and setfsxattrat syscalls to manip

Re: [PATCH v2] fs: introduce getfsxattrat and setfsxattrat syscalls

2025-01-24 Thread Christian Brauner
On Wed, Jan 22, 2025 at 03:18:34PM +0100, Andrey Albershteyn wrote: > From: Andrey Albershteyn > > Introduce getfsxattrat and setfsxattrat syscalls to manipulate inode > extended attributes/flags. The syscalls take parent directory FD and > path to the child together with struct fsxattr. > > Thi

Re: [PATCH] select: Fix unbalanced user_access_end()

2025-01-13 Thread Christian Brauner
On Mon, 13 Jan 2025 09:37:24 +0100, Christophe Leroy wrote: > While working on implementing user access validation on powerpc > I got the following warnings on a pmac32_defconfig build: > > CC fs/select.o > fs/select.o: warning: objtool: sys_pselect6+0x1bc: redundant UACCESS >

Re: [PATCH] selftests/mount_setattr: Fix failures on 64K PAGE_SIZE kernels

2024-11-20 Thread Christian Brauner
On Sat, 16 Nov 2024 00:41:14 +1100, Michael Ellerman wrote: > Currently the mount_setattr_test fails on machines with a 64K PAGE_SIZE, > with errors such as: > > # RUN mount_setattr_idmapped.invalid_fd_negative ... > mkfs.ext4: No space left on device while writing out and closing f

Re: [PATCH 01/15] ftruncate: pass a signed offset

2024-06-21 Thread Christian Brauner
s are all correct already and do not suffer > from this mistake. > > Fixes: 3f6d078d4acc ("fix compat truncate/ftruncate") > Cc: sta...@vger.kernel.org > Signed-off-by: Arnd Bergmann > --- Looks good to me, Reviewed-by: Christian Brauner

Re: [PATCH v2 2/4] eventfd: simplify eventfd_signal()

2024-02-08 Thread Christian Brauner
On Wed, Feb 07, 2024 at 03:34:59PM +0100, Paolo Bonzini wrote: > On Wed, Nov 22, 2023 at 1:49 PM Christian Brauner wrote: > > > > Ever since the evenfd type was introduced back in 2007 in commit > > e1ad7468c77d ("signal/timer/event: eventfd core") the eventfd_

Re: [linus:master] [file] 0ede61d858: will-it-scale.per_thread_ops -2.9% regression

2023-11-28 Thread Christian Brauner
On Mon, Nov 27, 2023 at 09:10:54AM -0800, Linus Torvalds wrote: > On Mon, 27 Nov 2023 at 02:27, Christian Brauner wrote: > > > > So I've picked up your patch (vfs.misc). It's clever alright so thanks > > for the comments in there otherwise I would've stared at

Re: [linus:master] [file] 0ede61d858: will-it-scale.per_thread_ops -2.9% regression

2023-11-27 Thread Christian Brauner
> So that nobody else would waste any time on this, attached is a new > attempt. This time actually tested *after* the changes. So I've picked up your patch (vfs.misc). It's clever alright so thanks for the comments in there otherwise I would've stared at this for far too long. It's a little unpl

Re: [linus:master] [file] 0ede61d858: will-it-scale.per_thread_ops -2.9% regression

2023-11-27 Thread Christian Brauner
> I took a look at the code generation, and honestly, I think we're > better off just making __fget_files_rcu() have special logic for this > all, and not use __get_file_rcu(). My initial massaging of the patch did that btw. Then I sat there wondering whether it would matter if we just made it pos

Re: [PATCH v2 0/4] eventfd: simplify signal helpers

2023-11-24 Thread Christian Brauner
On Wed, 22 Nov 2023 13:48:21 +0100, Christian Brauner wrote: > Hey everyone, > > This simplifies the eventfd_signal() and eventfd_signal_mask() helpers > significantly. They can be made void and not take any unnecessary > arguments. > > I've added a few more simpl

Re: [PATCH v2 2/4] eventfd: simplify eventfd_signal()

2023-11-23 Thread Christian Brauner
> > * eventfd_signal - Adds @n to the eventfd counter. > > This still refers to @n here, and in patch 4. Fixed and folded. Thanks!

Re: [PATCH v2 1/4] i915: make inject_virtual_interrupt() void

2023-11-23 Thread Christian Brauner
> > + if (!vgpu->msi_trigger) > > + return; > > + eventfd_signal(vgpu->msi_trigger, 1); > > } > > I think it's a little simpler to write as > if (vgpu->msi_trigger) > eventfd_signal(vgpu->msi_trigger, 1); Good point. I folded that suggestion into the patch.

[PATCH v2 4/4] eventfd: make eventfd_signal{_mask}() void

2023-11-22 Thread Christian Brauner
No caller care about the return value. Signed-off-by: Christian Brauner --- fs/eventfd.c| 40 +++- include/linux/eventfd.h | 16 +++- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/fs/eventfd.c b/fs/eventfd.c index

[PATCH v2 3/4] eventfd: simplify eventfd_signal_mask()

2023-11-22 Thread Christian Brauner
The eventfd_signal_mask() helper was introduced for io_uring and similar to eventfd_signal() it always passed 1 for @n. So don't bother with that argument at all. Signed-off-by: Christian Brauner --- fs/eventfd.c| 7 --- include/linux/eventfd.h | 5 ++--- io_uring/io_ur

[PATCH v2 2/4] eventfd: simplify eventfd_signal()

2023-11-22 Thread Christian Brauner
Ever since the evenfd type was introduced back in 2007 in commit e1ad7468c77d ("signal/timer/event: eventfd core") the eventfd_signal() function only ever passed 1 as a value for @n. There's no point in keeping that additional argument. Signed-off-by: Christian Brauner --- arch/x

[PATCH v2 1/4] i915: make inject_virtual_interrupt() void

2023-11-22 Thread Christian Brauner
The single caller of inject_virtual_interrupt() ignores the return value anyway. This allows us to simplify eventfd_signal() in follow-up patches. Signed-off-by: Christian Brauner --- drivers/gpu/drm/i915/gvt/interrupt.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

[PATCH v2 0/4] eventfd: simplify signal helpers

2023-11-22 Thread Christian Brauner
Hey everyone, This simplifies the eventfd_signal() and eventfd_signal_mask() helpers significantly. They can be made void and not take any unnecessary arguments. I've added a few more simplifications based on Sean's suggestion. Signed-off-by: Christian Brauner Changes in v2:

Re: [PATCH 14/34] fs: Rename anon_inode_getfile_secure() and anon_inode_getfd_secure()

2023-11-06 Thread Christian Brauner
y needs the symbol, they can ask or they can just use > anon_inode_create_getfile(), which will be exported very soon for use > in KVM. > > Suggested-by: Christian Brauner > Signed-off-by: Paolo Bonzini > --- Looks good to me, Reviewed-by: Christian Brauner

Re: [PATCH v13 15/35] fs: Export anon_inode_getfile_secure() for use by KVM

2023-11-02 Thread Christian Brauner
On Fri, Oct 27, 2023 at 11:21:57AM -0700, Sean Christopherson wrote: > Export anon_inode_getfile_secure() so that it can be used by KVM to create > and manage file-based guest memory without need a fullblow filesystem. > The "standard" anon_inode_getfd() doesn't work for KVM's use case as KVM > nee

Re: [PATCH v2 00/89] fs: new accessor methods for inode atime and mtime

2023-10-09 Thread Christian Brauner
On Wed, Oct 04, 2023 at 02:52:21PM -0400, Jeff Layton wrote: > v2: > - bugfix in mtime handling > - incorporate _sec and _nsec accessor functions (Chuck Lever) > - move i_generation to plug hole after changing timestamps (Amir Goldstein) > > While working on the multigrain timestamp changes, Linus

Re: [PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers

2023-09-29 Thread Christian Brauner
> It is a lot of churn though. I think that i_{a,c,m}time shouldn't be accessed directly by filesystems same as no filesystem should really access i_{g,u}id which we also provide i_{g,u}id_{read,write}() accessors for. The mode is another example where really most often should use helpers because

Re: [PATCH 87/87] fs: move i_blocks up a few places in struct inode

2023-09-29 Thread Christian Brauner
On Thu, Sep 28, 2023 at 10:41:34AM -0700, Linus Torvalds wrote: > On Thu, 28 Sept 2023 at 04:06, Jeff Layton wrote: > > > > Move i_blocks up above the i_lock, which moves the new 4 byte hole to > > just after the timestamps, without changing the size of the structure. > > I'm sure others have men

Re: [PATCH v4 2/5] fs: Add fchmodat2()

2023-07-27 Thread Christian Brauner
On Thu, Jul 27, 2023 at 01:13:37PM -0400, dal...@libc.org wrote: > On Thu, Jul 27, 2023 at 07:02:53PM +0200, Christian Brauner wrote: > > On Thu, Jul 27, 2023 at 06:28:53PM +0200, Andreas Schwab wrote: > > > On Jul 27 2023, David Laight wrote: > > > > > > &g

Re: [PATCH v4 2/5] fs: Add fchmodat2()

2023-07-27 Thread Christian Brauner
On Thu, Jul 27, 2023 at 06:28:53PM +0200, Andreas Schwab wrote: > On Jul 27 2023, David Laight wrote: > > > From: Aleksa Sarai > >> Sent: 25 July 2023 17:36 > > ... > >> We almost certainly want to support AT_EMPTY_PATH at the same time. > >> Otherwise userspace will still need to go through /proc

Re: [PATCH v4 3/5] arch: Register fchmodat2, usually as syscall 452

2023-07-27 Thread Christian Brauner
On Wed, Jul 26, 2023 at 02:43:41AM +1000, Aleksa Sarai wrote: > On 2023-07-11, Alexey Gladkov wrote: > > From: Palmer Dabbelt > > > > This registers the new fchmodat2 syscall in most places as nuber 452, > > with alpha being the exception where it's 562. I found all these sites > > by grepping

Re: [PATCH v4 2/5] fs: Add fchmodat2()

2023-07-27 Thread Christian Brauner
> > I think it'd be much neater to do the conversion of AT_ flags here and > > pass 0 as a flags argument for all of the wrappers (this is how most of > > the other xyz(), fxyz(), fxyzat() syscall wrappers are done IIRC). I've fixed that up in-tree.

Re: Add fchmodat2() - or add a more general syscall?

2023-07-27 Thread Christian Brauner
On Wed, Jul 26, 2023 at 08:57:10PM -0700, Eric Biggers wrote: > On Tue, Jul 25, 2023 at 04:58:34PM +0100, David Howells wrote: > > Rather than adding a fchmodat2() syscall, should we add a "set_file_attrs()" > > syscall that takes a mask and allows you to set a bunch of stuff all in one > > go? Ba

Re: Add fchmodat2() - or add a more general syscall?

2023-07-26 Thread Christian Brauner
On Tue, Jul 25, 2023 at 07:39:51PM +0100, David Howells wrote: > Florian Weimer wrote: > > > > Rather than adding a fchmodat2() syscall, should we add a > > > "set_file_attrs()" syscall that takes a mask and allows you to set a bunch > > > of stuff all in one go? Basically, an interface to notif

Re: [PATCH v3 0/5] Add a new fchmodat4() syscall

2023-07-25 Thread Christian Brauner
On Tue, Jul 25, 2023 at 01:05:40PM +0200, Alexey Gladkov wrote: > On Tue, Jul 11, 2023 at 05:14:24PM +0200, Christian Brauner wrote: > > On Tue, Jul 11, 2023 at 02:24:51PM +0200, Florian Weimer wrote: > > > * Alexey Gladkov: > > > > > > > This patch set adds

Re: [PATCH 0/2] eventfd: simplify signal helpers

2023-07-14 Thread Christian Brauner
On Thu, Jul 13, 2023 at 11:10:54AM -0600, Alex Williamson wrote: > On Thu, 13 Jul 2023 12:05:36 +0200 > Christian Brauner wrote: > > > Hey everyone, > > > > This simplifies the eventfd_signal() and eventfd_signal_mask() helpers > > by removing the count arg

Re: [PATCH 2/2] eventfd: simplify eventfd_signal_mask()

2023-07-13 Thread Christian Brauner
On Thu, Jul 13, 2023 at 07:33:05AM -0700, Sean Christopherson wrote: > On Thu, Jul 13, 2023, Christian Brauner wrote: > > diff --git a/fs/eventfd.c b/fs/eventfd.c > > index dc9e01053235..077be5da72bd 100644 > > --- a/fs/eventfd.c > > +++ b/fs/eventfd.c > > @@ -

[PATCH 2/2] eventfd: simplify eventfd_signal_mask()

2023-07-13 Thread Christian Brauner
The eventfd_signal_mask() helper was introduced for io_uring and similar to eventfd_signal() it always passed 1 for @n. So don't bother with that argument at all. Signed-off-by: Christian Brauner --- drivers/gpu/drm/i915/gvt/interrupt.c | 2 +- fs/eventfd.c

[PATCH 1/2] eventfd: simplify eventfd_signal()

2023-07-13 Thread Christian Brauner
Ever since the evenfd type was introduced back in 2007 in commit e1ad7468c77d ("signal/timer/event: eventfd core") the eventfd_signal() function only ever passed 1 as a value for @n. There's no point in keeping that additional argument. Signed-off-by: Christian Brauner --- arch/x

[PATCH 0/2] eventfd: simplify signal helpers

2023-07-13 Thread Christian Brauner
Hey everyone, This simplifies the eventfd_signal() and eventfd_signal_mask() helpers by removing the count argument which is effectively unused. --- --- base-commit: 6be357f00aad4189130147fdc6f568cf776a4909 change-id: 20230713-vfs-eventfd-signal-0b0d167ad6ec

Re: [PATCH v3 0/5] Add a new fchmodat4() syscall

2023-07-11 Thread Christian Brauner
On Tue, Jul 11, 2023 at 02:24:51PM +0200, Florian Weimer wrote: > * Alexey Gladkov: > > > This patch set adds fchmodat4(), a new syscall. The actual > > implementation is super simple: essentially it's just the same as > > fchmodat(), but LOOKUP_FOLLOW is conditionally set based on the flags. > >

Re: [PATCH v3 2/5] fs: Add fchmodat4()

2023-07-11 Thread Christian Brauner
On Tue, Jul 11, 2023 at 02:51:01PM +0200, Alexey Gladkov wrote: > On Tue, Jul 11, 2023 at 01:52:01PM +0200, Christian Brauner wrote: > > On Tue, Jul 11, 2023 at 01:42:19PM +0200, Arnd Bergmann wrote: > > > On Tue, Jul 11, 2023, at 13:25, Alexey Gladkov wrote: > >

Re: (subset) [PATCH v4 0/5] Add a new fchmodat2() syscall

2023-07-11 Thread Christian Brauner
On Tue, 11 Jul 2023 18:16:02 +0200, Alexey Gladkov wrote: > In glibc, the fchmodat(3) function has a flags argument according to the > POSIX specification [1], but kernel syscalls has no such argument. > Therefore, libc implementations do workarounds using /proc. However, > this requires procfs to

Re: [PATCH v4 2/5] fs: Add fchmodat2()

2023-07-11 Thread Christian Brauner
On Tue, Jul 11, 2023 at 06:16:04PM +0200, Alexey Gladkov wrote: > On the userspace side fchmodat(3) is implemented as a wrapper > function which implements the POSIX-specified interface. This > interface differs from the underlying kernel system call, which does not > have a flags argument. Most im

Re: [PATCH v3 2/5] fs: Add fchmodat4()

2023-07-11 Thread Christian Brauner
On Tue, Jul 11, 2023 at 01:42:19PM +0200, Arnd Bergmann wrote: > On Tue, Jul 11, 2023, at 13:25, Alexey Gladkov wrote: > > From: Palmer Dabbelt > > > > On the userspace side fchmodat(3) is implemented as a wrapper > > function which implements the POSIX-specified interface. This > > interface diff

Re: [PATCH v2 00/89] fs: new accessors for inode->i_ctime

2023-07-10 Thread Christian Brauner
On Fri, Jul 07, 2023 at 08:42:31AM -0400, Jeff Layton wrote: > On Wed, 2023-07-05 at 14:58 -0400, Jeff Layton wrote: > > v2: > > - prepend patches to add missing ctime updates > > - add simple_rename_timestamp helper function > > - rename ctime accessor functions as inode_get_ctime/inode_set_ctime_

Re: [PATCH v2 00/92] fs: new accessors for inode->i_ctime

2023-07-10 Thread Christian Brauner
On Wed, 05 Jul 2023 14:58:09 -0400, Jeff Layton wrote: > v2: > - prepend patches to add missing ctime updates > - add simple_rename_timestamp helper function > - rename ctime accessor functions as inode_get_ctime/inode_set_ctime_* > - drop individual inode_ctime_set_{sec,nsec} helpers > > I've bee

Re: [PATCH 00/79] fs: new accessors for inode->i_ctime

2023-06-23 Thread Christian Brauner
On Wed, Jun 21, 2023 at 03:52:27PM -0400, Jeff Layton wrote: > On Wed, 2023-06-21 at 15:21 -0400, Steven Rostedt wrote: > > On Wed, 21 Jun 2023 10:45:05 -0400 > > Jeff Layton wrote: > > > > > Most of this conversion was done via coccinelle, with a few of the more > > > non-standard accesses done

Re: [PATCH] procfs: consolidate arch_report_meminfo declaration

2023-05-17 Thread Christian Brauner
On Tue, 16 May 2023 21:57:29 +0200, Arnd Bergmann wrote: > The arch_report_meminfo() function is provided by four architectures, > with a __weak fallback in procfs itself. On architectures that don't > have a custom version, the __weak version causes a warning because > of the missing prototype. >

Re: [RFC PATCH v2] fs/xattr: add *at family syscalls

2023-05-15 Thread Christian Brauner
On Mon, May 15, 2023 at 04:04:21PM +0300, Amir Goldstein wrote: > On Mon, May 15, 2023 at 1:33 PM Christian Brauner wrote: > > > > On Thu, May 11, 2023 at 05:08:02PM +0200, Christian Göttsche wrote: > > > Add the four syscalls setxattrat(), getxattrat(), listxattrat()

Re: [RFC PATCH v2] fs/xattr: add *at family syscalls

2023-05-15 Thread Christian Brauner
On Thu, May 11, 2023 at 05:08:02PM +0200, Christian Göttsche wrote: > 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

Re: [RFC PATCH 2/2] fs/xattr: wire up syscalls

2022-08-30 Thread Christian Brauner
On Tue, Aug 30, 2022 at 05:28:38PM +0200, Christian Göttsche wrote: > Enable the new added extended attribute related syscalls. > > Signed-off-by: Christian Göttsche > --- Fwiw, I think a while ago it was pointed out that for most syscall additions you can just fold the hookup patch in. It proba

Re: [RFC PATCH v2 2/3] fs: define a firmware security filesystem named fwsecurityfs

2022-06-28 Thread Christian Brauner
On Mon, Jun 27, 2022 at 09:37:28AM +0200, Greg Kroah-Hartman wrote: > On Sun, Jun 26, 2022 at 11:48:06AM -0400, Mimi Zohar wrote: > > On Thu, 2022-06-23 at 09:23 -0400, James Bottomley wrote: > > > On Thu, 2022-06-23 at 10:54 +0200, Greg Kroah-Hartman wrote: > > > [...] > > > > > diff --git a/fs/fw

Re: [PATCH v4 2/3] audit: add support for the openat2 syscall

2021-05-20 Thread Christian Brauner
; @@ -76,6 +76,7 @@ > #include > #include > #include > +#include > > #include "audit.h" > > @@ -196,6 +197,8 @@ static int audit_match_perm(struct audit_context *ctx, > int mask) > return ((mask & AUDIT_PERM_WRITE) && ctx->argv[0] == SYS_BIND); > case AUDITSC_EXECVE: > return mask & AUDIT_PERM_EXEC; > + case AUDITSC_OPENAT2: > + return mask & ACC_MODE((u32)((struct open_how > *)ctx->argv[2])->flags); That's a lot of dereferncing, casting and masking all at once. Maybe a small static inline helper would be good for the sake of legibility? Sm like: static inline u32 audit_openat2_acc(struct open_how *how, int mask) { u32 flags = how->flags; return mask & ACC_MODE(flags); } but not sure. Just seems more legible to me. Otherwise. Acked-by: Christian Brauner

Re: [PATCH v4 1/3] audit: replace magic audit syscall class numbers with macros

2021-05-20 Thread Christian Brauner
d 32 bit in any compat code, causing > redefinition warnings. > > Signed-off-by: Richard Guy Briggs > Link: > https://lore.kernel.org/r/2300b1083a32aade7ae7efb95826e8f3f260b1df.1621363275.git@redhat.com Looks good. Acked-by: Christian Brauner Fwiw, I would explic

Re: [PATCH 1/2] audit: add support for the openat2 syscall

2021-04-23 Thread Christian Brauner
On Thu, Apr 22, 2021 at 10:34:08PM -0400, Richard Guy Briggs wrote: > On 2021-03-18 08:08, Richard Guy Briggs wrote: > > On 2021-03-18 11:48, Christian Brauner wrote: > > > [+Cc Aleksa, the author of openat2()] > > > > Ah! Thanks for pulling in Aleksa

Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers

2021-04-06 Thread Christian Brauner
. (Be good to see kbuild do an allmodconfig build of this though.) Acked-by: Christian Brauner > arch/powerpc/kernel/setup-common.c | 1 + > arch/x86/include/asm/desc.h | 1 + > arch/x86/kernel/cpu/mshyperv.c | 1 + > arch/x86/kernel/setup.c | 1 + &g

Re: [PATCH 1/2] audit: add support for the openat2 syscall

2021-03-18 Thread Christian Brauner
On Thu, Mar 18, 2021 at 11:48:45AM +0100, Christian Brauner wrote: > [+Cc Aleksa, the author of openat2()] > > and a comment below. :) > > On Wed, Mar 17, 2021 at 09:47:17PM -0400, Richard Guy Briggs wrote: > > The openat2(2) syscall was added in kernel v5.6 with commit fd

Re: [PATCH 1/2] audit: add support for the openat2 syscall

2021-03-18 Thread Christian Brauner
[+Cc Aleksa, the author of openat2()] and a comment below. :) On Wed, Mar 17, 2021 at 09:47:17PM -0400, Richard Guy Briggs wrote: > The openat2(2) syscall was added in kernel v5.6 with commit fddb5d430ad9 > ("open: introduce openat2(2) syscall") > > Add the openat2(2) syscall to the audit syscal

Re: [PATCH 2/9] fs: add an argument-less alloc_anon_inode

2021-03-10 Thread Christian Brauner
On Tue, Mar 09, 2021 at 04:53:41PM +0100, Christoph Hellwig wrote: > Add a new alloc_anon_inode helper that allocates an inode on > the anon_inode file system. > > Signed-off-by: Christoph Hellwig > --- Looks good! Reviewed-by: Christian Brauner

Re: [PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-10 Thread Christian Brauner
kernel.org/lkml/20210310083040.ga5...@lst.de) Reviewed-by: Christian Brauner > arch/powerpc/platforms/pseries/cmm.c | 2 +- > drivers/dma-buf/dma-buf.c| 2 +- > drivers/gpu/drm/drm_drv.c| 2 +- > drivers/misc/cxl/api.c | 2 +- > drivers/mi

Re: [PATCH v2 4/4] selftests/clone3: Avoid OS-defined clone_args

2020-09-21 Thread Christian Brauner
; macro names to match UAPI names. > > Signed-off-by: Kees Cook > --- Looks good, thanks! Acked-by: Christian Brauner

Re: [PATCH v2 3/4] selftests/seccomp: powerpc: Set syscall return during ptrace syscall exit

2020-09-21 Thread Christian Brauner
; Suggested-by: Thadeu Lima de Souza Cascardo > Link: > https://lore.kernel.org/linux-kselftest/20200911181012.171027-1-casca...@canonical.com/ > Fixes: 58d0a862f573 ("seccomp: add tests for ptrace hole") > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH v2 2/4] selftests/seccomp: Allow syscall nr and ret value to be set separately

2020-09-21 Thread Christian Brauner
regset > read/write happening once and in one code path. > > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH v2 1/4] selftests/seccomp: Record syscall during ptrace entry

2020-09-21 Thread Christian Brauner
if (!entry) > + /* > + * Some architectures only support setting return values during > + * syscall exit under ptrace, and on exit the syscall number may > + * no longer be available. Therefore, save the initial sycall s/sycall/syscall/ Otherwise looks good. Thank

Re: [PATCH 14/15] selftests/clone3: Avoid OS-defined clone_args

2020-09-15 Thread Christian Brauner
On Sat, Sep 12, 2020 at 04:08:19AM -0700, Kees Cook wrote: > As the UAPI headers start to appear in distros, we need to avoid > outdated versions of struct clone_args to be able to test modern > features. Additionally pull in the syscall numbers correctly. > > Signed-off-by: Kees Cook > --- Hm,

Re: [PATCH 15/15] selftests/seccomp: Use __NR_mknodat instead of __NR_mknod

2020-09-15 Thread Christian Brauner
ook > --- Thanks! Looks good. Acked-by: Christian Brauner

Re: [PATCH 11/15] selftests/seccomp: Remove SYSCALL_NUM_RET_SHARE_REG in favor of SYSCALL_RET_SET

2020-09-15 Thread Christian Brauner
> return value (for whatever reason), they can define SYSCALL_RET_SET() > without an associated SYSCALL_RET() macro. This also paves the way for > architectures that need to do special things to set the return value > (e.g. powerpc). > > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 10/15] selftests/seccomp: Avoid redundant register flushes

2020-09-15 Thread Christian Brauner
Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 09/15] selftests/seccomp: Convert REGSET calls into ARCH_GETREG/ARCH_SETREG

2020-09-15 Thread Christian Brauner
On Sat, Sep 12, 2020 at 04:08:14AM -0700, Kees Cook wrote: > Consolidate the REGSET logic into the new ARCH_GETREG() and > ARCH_SETREG() macros, avoiding more #ifdef code in function bodies. > > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 08/15] selftests/seccomp: Convert HAVE_GETREG into ARCH_GETREG/ARCH_SETREG

2020-09-15 Thread Christian Brauner
On Sat, Sep 12, 2020 at 04:08:13AM -0700, Kees Cook wrote: > Instead of special-casing the get/set-registers routines, move the > HAVE_GETREG logic into the new ARCH_GETREG() and ARCH_SETREG() macros. > > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 07/15] selftests/seccomp: Remove syscall setting #ifdefs

2020-09-15 Thread Christian Brauner
On Sat, Sep 12, 2020 at 04:08:12AM -0700, Kees Cook wrote: > With all architectures now using the common SYSCALL_NUM_SET() macro, the > arch-specific #ifdef can be removed from change_syscall() itself. > > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 06/15] selftests/seccomp: mips: Remove O32-specific macro

2020-09-15 Thread Christian Brauner
; Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 05/15] selftests/seccomp: arm64: Define SYSCALL_NUM_SET macro

2020-09-15 Thread Christian Brauner
On Sat, Sep 12, 2020 at 04:08:10AM -0700, Kees Cook wrote: > Remove the arm64 special-case in change_syscall(). > > Signed-off-by: Kees Cook > --- We're using iovecs in ptrace()?? Looks good! Acked-by: Christian Brauner

Re: [PATCH 04/15] selftests/seccomp: arm: Define SYSCALL_NUM_SET macro

2020-09-15 Thread Christian Brauner
On Sat, Sep 12, 2020 at 04:08:09AM -0700, Kees Cook wrote: > Remove the arm special-case in change_syscall(). > > Signed-off-by: Kees Cook > --- Looks good! Acked-by: Christian Brauner

Re: [PATCH 03/15] selftests/seccomp: mips: Define SYSCALL_NUM_SET macro

2020-09-15 Thread Christian Brauner
\ (_regs).regs[2] = _nr; \ } while (0) would read better but that's just a matter of taste. :) Looks good! Acked-by: Christian Brauner

Re: [PATCH 02/15] selftests/seccomp: Provide generic syscall setting macro

2020-09-15 Thread Christian Brauner
good either way! Acked-by: Christian Brauner

Re: [PATCH 01/15] selftests/seccomp: Refactor arch register macros to avoid xtensa special case

2020-09-15 Thread Christian Brauner
oks good! Acked-by: Christian Brauner

Re: [PATCH 17/17] arch: rename copy_thread_tls() back to copy_thread()

2020-07-04 Thread Christian Brauner
On Fri, Jun 26, 2020 at 06:17:49AM +0900, Stafford Horne wrote: > On Tue, Jun 23, 2020 at 01:43:26AM +0200, Christian Brauner wrote: > > > diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c > > index d7010e72450c..19045a3efb8a 100644 > > --

[PATCH 17/17] arch: rename copy_thread_tls() back to copy_thread()

2020-06-22 Thread Christian Brauner
i...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Signed-off-by: Christian Brauner --- arch/alpha/kernel/process.c | 2 +- arch/arc/kernel/process.c|

[PATCH 16/17] arch: remove HAVE_COPY_THREAD_TLS

2020-06-22 Thread Christian Brauner
recores.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-xte...@linux-xtensa.org Signed-off-by: Christian B

Re: linux-next: manual merge of the pidfd tree with the powerpc-fixes tree

2020-06-19 Thread Christian Brauner
On Fri, Jun 19, 2020 at 09:17:30PM +1000, Michael Ellerman wrote: > Stephen Rothwell writes: > > Hi all, > > > > Today's linux-next merge of the pidfd tree got a conflict in: > > > > arch/powerpc/kernel/syscalls/syscall.tbl > > > > between commit: > > > > 35e32a6cb5f6 ("powerpc/syscalls: Split

[PATCH v5 2/3] arch: wire-up close_range()

2020-06-02 Thread Christian Brauner
This wires up the close_range() syscall into all arches at once. Suggested-by: Arnd Bergmann Signed-off-by: Christian Brauner Reviewed-by: Oleg Nesterov Acked-by: Arnd Bergmann Acked-by: Michael Ellerman (powerpc) Cc: Jann Horn Cc: David Howells Cc: Dmitry V. Levin Cc: Linus Torvalds Cc

Re: [PATCH] selftests: pidfd: Add pidfd_fdinfo_test in .gitignore

2020-02-28 Thread Christian Brauner
On Fri, Feb 28, 2020 at 01:18:44AM +0100, Christian Brauner wrote: > On February 28, 2020 1:00:08 AM GMT+01:00, Christophe Leroy > wrote: > >The commit identified below added pidfd_fdinfo_test > >but failed to add it to .gitignore > > > >Fixes: 2def297ec7fb ("

Re: [PATCH] selftests: pidfd: Add pidfd_fdinfo_test in .gitignore

2020-02-27 Thread Christian Brauner
ests/pidfd/.gitignore >+++ b/tools/testing/selftests/pidfd/.gitignore >@@ -2,4 +2,5 @@ pidfd_open_test > pidfd_poll_test > pidfd_test > pidfd_wait >+pidfd_fdinfo_test > pidfd_getfd_test Thanks for spotting this. I'll pick this up along with other fixes I have waiting. Acked-by: Christian Brauner

Re: [PATCH v15 0/9] open: introduce openat2(2) syscall

2019-11-12 Thread Christian Brauner
On Tue, Nov 12, 2019 at 03:01:26PM -0800, Kees Cook wrote: > On Tue, Nov 12, 2019 at 12:24:04AM +1100, Aleksa Sarai wrote: > > On 2019-11-05, Aleksa Sarai wrote: > > > This patchset is being developed here: > > > > > > > > > Patch changelog:

Re: [PATCH 12/23] y2038: syscalls: change remaining timeval to __kernel_old_timeval

2019-11-11 Thread Christian Brauner
eval type in user space. > > Signed-off-by: Arnd Bergmann Seems reasonable. Acked-by: Christian Brauner

[REVIEW PATCH v5 2/3] arch: wire-up close_range()

2019-10-25 Thread Christian Brauner
This wires up the close_range() syscall into all arches at once. Suggested-by: Arnd Bergmann Signed-off-by: Christian Brauner Reviewed-by: Oleg Nesterov Acked-by: Arnd Bergmann Acked-by: Michael Ellerman (powerpc) Cc: Jann Horn Cc: David Howells Cc: Dmitry V. Levin Cc: Linus Torvalds Cc

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Fri, Sep 06, 2019 at 05:56:18AM +1000, Aleksa Sarai wrote: > On 2019-09-05, Al Viro wrote: > > On Thu, Sep 05, 2019 at 08:23:03PM +0200, Christian Brauner wrote: > > > > > Because every caller of that function right now has that limit set > > > anyway iirc

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 07:28:01PM +0100, Al Viro wrote: > On Thu, Sep 05, 2019 at 08:23:03PM +0200, Christian Brauner wrote: > > > Because every caller of that function right now has that limit set > > anyway iirc. So we can either remove it from here and place it back for

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 07:07:50PM +0100, Al Viro wrote: > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > +/* > > + * "memset(p, 0, size)" but for user space buffers. Caller must have > > already > > + * checked access_ok(p, size). > > + */ > > +static int __memzero_user(void __

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 09:27:18PM +1000, Aleksa Sarai wrote: > On 2019-09-05, Christian Brauner wrote: > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > > A common pattern for syscall extensions is increasing the size of a > > > struct passed fr

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 01:17:38PM +0200, Rasmus Villemoes wrote: > On 05/09/2019 13.05, Christian Brauner wrote: > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > >> + if (unlikely(!access_ok(dst, usize))) > >> + return -EFAULT; > &

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > A common pattern for syscall extensions is increasing the size of a > struct passed from userspace, such that the zero-value of the new fields > result in the old kernel behaviour (allowing for a mix of userspace and > kernel vintages

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > A common pattern for syscall extensions is increasing the size of a > struct passed from userspace, such that the zero-value of the new fields > result in the old kernel behaviour (allowing for a mix of userspace and > kernel vintages

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 07:50:26PM +1000, Aleksa Sarai wrote: > On 2019-09-05, Rasmus Villemoes wrote: > > On 04/09/2019 22.19, Aleksa Sarai wrote: > > > A common pattern for syscall extensions is increasing the size of a > > > struct passed from userspace, such that the zero-value of the new fiel

  1   2   >