public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the security tree with the vfs-brauner tree
@ 2023-11-20  3:31 Stephen Rothwell
  2023-11-20 21:09 ` Paul Moore
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2023-11-20  3:31 UTC (permalink / raw)
  To: Paul Moore, Christian Brauner
  Cc: Casey Schaufler, Linux Kernel Mailing List,
	Linux Next Mailing List, Miklos Szeredi

[-- Attachment #1: Type: text/plain, Size: 15972 bytes --]

Hi all,

Today's linux-next merge of the security tree got conflicts in:

  arch/alpha/kernel/syscalls/syscall.tbl
  arch/arm/tools/syscall.tbl
  arch/arm64/include/asm/unistd32.h
  arch/m68k/kernel/syscalls/syscall.tbl
  arch/microblaze/kernel/syscalls/syscall.tbl
  arch/mips/kernel/syscalls/syscall_n32.tbl
  arch/mips/kernel/syscalls/syscall_n64.tbl
  arch/mips/kernel/syscalls/syscall_o32.tbl
  arch/parisc/kernel/syscalls/syscall.tbl
  arch/powerpc/kernel/syscalls/syscall.tbl
  arch/s390/kernel/syscalls/syscall.tbl
  arch/sh/kernel/syscalls/syscall.tbl
  arch/sparc/kernel/syscalls/syscall.tbl
  arch/x86/entry/syscalls/syscall_32.tbl
  arch/x86/entry/syscalls/syscall_64.tbl
  arch/xtensa/kernel/syscalls/syscall.tbl
  include/uapi/asm-generic/unistd.h

between commit:

  9fa5392c080e ("wire up syscalls for statmount/listmount")

from the vfs-brauner tree and commit:

  5f42375904b0 ("LSM: wireup Linux Security Module syscalls")

from the security tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

I also needed this merge fix patch (the former commit neglected to
update this file).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 20 Nov 2023 14:27:19 +1100
Subject: [PATCH] fix up for "LSM: wireup Linux Security Module syscalls"

interacting with commit "wire up syscalls for statmount/listmount"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/arm64/include/asm/unistd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index abe10a833fcd..491b2b9bd553 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -39,7 +39,7 @@
 #define __ARM_NR_compat_set_tls		(__ARM_NR_COMPAT_BASE + 5)
 #define __ARM_NR_COMPAT_END		(__ARM_NR_COMPAT_BASE + 0x800)
 
-#define __NR_compat_syscalls		460
+#define __NR_compat_syscalls		462
 #endif
 
 #define __ARCH_WANT_SYS_CLONE
-- 
2.40.1

-- 
Cheers,
Stephen Rothwell

diff --cc arch/alpha/kernel/syscalls/syscall.tbl
index 186e785f5b56,b04af0c9fcbc..000000000000
--- a/arch/alpha/kernel/syscalls/syscall.tbl
+++ b/arch/alpha/kernel/syscalls/syscall.tbl
@@@ -496,5 -496,6 +496,8 @@@
  564	common	futex_wake			sys_futex_wake
  565	common	futex_wait			sys_futex_wait
  566	common	futex_requeue			sys_futex_requeue
 -567	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -568	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -569	common	lsm_list_modules		sys_lsm_list_modules
 +567	common	statmount			sys_statmount
 +568	common	listmount			sys_listmount
++569	common	lsm_get_self_attr		sys_lsm_get_self_attr
++570	common	lsm_set_self_attr		sys_lsm_set_self_attr
++571	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/arm/tools/syscall.tbl
index d6a324dbff2e,43313beefae7..000000000000
--- a/arch/arm/tools/syscall.tbl
+++ b/arch/arm/tools/syscall.tbl
@@@ -470,5 -470,6 +470,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/arm64/include/asm/unistd32.h
index 8a191423c316,ab1a7c2b6653..000000000000
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@@ -919,10 -919,12 +919,16 @@@ __SYSCALL(__NR_futex_wake, sys_futex_wa
  __SYSCALL(__NR_futex_wait, sys_futex_wait)
  #define __NR_futex_requeue 456
  __SYSCALL(__NR_futex_requeue, sys_futex_requeue)
 -#define __NR_lsm_get_self_attr 457
 +#define __NR_statmount 457
 +__SYSCALL(__NR_statmount, sys_statmount)
 +#define __NR_listmount 458
 +__SYSCALL(__NR_listmount, sys_listmount)
++#define __NR_lsm_get_self_attr 459
+ __SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr)
 -#define __NR_lsm_set_self_attr 458
++#define __NR_lsm_set_self_attr 460
+ __SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)
 -#define __NR_lsm_list_modules 459
++#define __NR_lsm_list_modules 461
+ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
  
  /*
   * Please add new compat syscalls above this comment and update
diff --cc arch/m68k/kernel/syscalls/syscall.tbl
index 37db1a810b67,90629ffc6732..000000000000
--- a/arch/m68k/kernel/syscalls/syscall.tbl
+++ b/arch/m68k/kernel/syscalls/syscall.tbl
@@@ -456,5 -456,6 +456,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/microblaze/kernel/syscalls/syscall.tbl
index 07fff5ad1c9c,c395dece73b4..000000000000
--- a/arch/microblaze/kernel/syscalls/syscall.tbl
+++ b/arch/microblaze/kernel/syscalls/syscall.tbl
@@@ -462,5 -462,6 +462,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/mips/kernel/syscalls/syscall_n32.tbl
index 134ea054b1c7,4a876c4e77d6..000000000000
--- a/arch/mips/kernel/syscalls/syscall_n32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
@@@ -395,5 -395,6 +395,8 @@@
  454	n32	futex_wake			sys_futex_wake
  455	n32	futex_wait			sys_futex_wait
  456	n32	futex_requeue			sys_futex_requeue
 -457	n32	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	n32	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	n32	lsm_list_modules		sys_lsm_list_modules
 +457	n32	statmount			sys_statmount
 +458	n32	listmount			sys_listmount
++459	n32	lsm_get_self_attr		sys_lsm_get_self_attr
++460	n32	lsm_set_self_attr		sys_lsm_set_self_attr
++461	n32	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/mips/kernel/syscalls/syscall_n64.tbl
index 959a21664703,b74c8571f063..000000000000
--- a/arch/mips/kernel/syscalls/syscall_n64.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n64.tbl
@@@ -371,5 -371,6 +371,8 @@@
  454	n64	futex_wake			sys_futex_wake
  455	n64	futex_wait			sys_futex_wait
  456	n64	futex_requeue			sys_futex_requeue
 -457	n64	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	n64	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	n64	lsm_list_modules		sys_lsm_list_modules
 +457	n64	statmount			sys_statmount
 +458	n64	listmount			sys_listmount
++459	n64	lsm_get_self_attr		sys_lsm_get_self_attr
++460	n64	lsm_set_self_attr		sys_lsm_set_self_attr
++461	n64	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/mips/kernel/syscalls/syscall_o32.tbl
index e55bc1d4bf0f,bf41906e1f68..000000000000
--- a/arch/mips/kernel/syscalls/syscall_o32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
@@@ -444,5 -444,6 +444,8 @@@
  454	o32	futex_wake			sys_futex_wake
  455	o32	futex_wait			sys_futex_wait
  456	o32	futex_requeue			sys_futex_requeue
 -457	o32	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	032	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	o32	lsm_list_modules		sys_lsm_list_modules
 +457	o32	statmount			sys_statmount
 +458	o32	listmount			sys_listmount
++459	o32	lsm_get_self_attr		sys_lsm_get_self_attr
++460	032	lsm_set_self_attr		sys_lsm_set_self_attr
++461	o32	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/parisc/kernel/syscalls/syscall.tbl
index 9c84470c31c7,ccc0a679e774..000000000000
--- a/arch/parisc/kernel/syscalls/syscall.tbl
+++ b/arch/parisc/kernel/syscalls/syscall.tbl
@@@ -455,5 -455,6 +455,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/powerpc/kernel/syscalls/syscall.tbl
index 6988ecbc316e,a6f37e2333cb..000000000000
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
@@@ -543,5 -543,6 +543,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/s390/kernel/syscalls/syscall.tbl
index 5f5cd20ebb34,4b818e9ee832..000000000000
--- a/arch/s390/kernel/syscalls/syscall.tbl
+++ b/arch/s390/kernel/syscalls/syscall.tbl
@@@ -459,5 -459,6 +459,8 @@@
  454  common	futex_wake		sys_futex_wake			sys_futex_wake
  455  common	futex_wait		sys_futex_wait			sys_futex_wait
  456  common	futex_requeue		sys_futex_requeue		sys_futex_requeue
 -457  common	lsm_get_self_attr	sys_lsm_get_self_attr		sys_lsm_get_self_attr
 -458  common	lsm_set_self_attr	sys_lsm_set_self_attr		sys_lsm_set_self_attr
 -459  common	lsm_list_modules	sys_lsm_list_modules		sys_lsm_list_modules
 +457  common	statmount		sys_statmount			sys_statmount
 +458  common	listmount		sys_listmount			sys_listmount
++459  common	lsm_get_self_attr	sys_lsm_get_self_attr		sys_lsm_get_self_attr
++460  common	lsm_set_self_attr	sys_lsm_set_self_attr		sys_lsm_set_self_attr
++461  common	lsm_list_modules	sys_lsm_list_modules		sys_lsm_list_modules
diff --cc arch/sh/kernel/syscalls/syscall.tbl
index 3103ebd2e4cb,1a3d88d1a07f..000000000000
--- a/arch/sh/kernel/syscalls/syscall.tbl
+++ b/arch/sh/kernel/syscalls/syscall.tbl
@@@ -459,5 -459,6 +459,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/sparc/kernel/syscalls/syscall.tbl
index ba147d7ad19a,e0e8cec62358..000000000000
--- a/arch/sparc/kernel/syscalls/syscall.tbl
+++ b/arch/sparc/kernel/syscalls/syscall.tbl
@@@ -502,5 -502,6 +502,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc arch/x86/entry/syscalls/syscall_32.tbl
index 56e6c2f3ee9c,6e45e693f339..000000000000
--- a/arch/x86/entry/syscalls/syscall_32.tbl
+++ b/arch/x86/entry/syscalls/syscall_32.tbl
@@@ -461,5 -461,6 +461,8 @@@
  454	i386	futex_wake		sys_futex_wake
  455	i386	futex_wait		sys_futex_wait
  456	i386	futex_requeue		sys_futex_requeue
 -457	i386	lsm_get_self_attr	sys_lsm_get_self_attr
 -458	i386	lsm_set_self_attr	sys_lsm_set_self_attr
 -459	i386	lsm_list_modules	sys_lsm_list_modules
 +457	i386	statmount		sys_statmount
 +458	i386	listmount		sys_listmount
++459	i386	lsm_get_self_attr	sys_lsm_get_self_attr
++460	i386	lsm_set_self_attr	sys_lsm_set_self_attr
++461	i386	lsm_list_modules	sys_lsm_list_modules
diff --cc arch/x86/entry/syscalls/syscall_64.tbl
index 3a22eef585c2,d3b41d059d4d..000000000000
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@@ -378,8 -378,9 +378,11 @@@
  454	common	futex_wake		sys_futex_wake
  455	common	futex_wait		sys_futex_wait
  456	common	futex_requeue		sys_futex_requeue
 -457	common	lsm_get_self_attr	sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr	sys_lsm_set_self_attr
 -459	common	lsm_list_modules	sys_lsm_list_modules
 +457	common	statmount		sys_statmount
 +458	common	listmount		sys_listmount
++459	common	lsm_get_self_attr	sys_lsm_get_self_attr
++460	common	lsm_set_self_attr	sys_lsm_set_self_attr
++461	common	lsm_list_modules	sys_lsm_list_modules
  
  #
  # Due to a historical design error, certain syscalls are numbered differently
diff --cc arch/xtensa/kernel/syscalls/syscall.tbl
index 497b5d32f457,284784ea5a46..000000000000
--- a/arch/xtensa/kernel/syscalls/syscall.tbl
+++ b/arch/xtensa/kernel/syscalls/syscall.tbl
@@@ -427,5 -427,6 +427,8 @@@
  454	common	futex_wake			sys_futex_wake
  455	common	futex_wait			sys_futex_wait
  456	common	futex_requeue			sys_futex_requeue
 -457	common	lsm_get_self_attr		sys_lsm_get_self_attr
 -458	common	lsm_set_self_attr		sys_lsm_set_self_attr
 -459	common	lsm_list_modules		sys_lsm_list_modules
 +457	common	statmount			sys_statmount
 +458	common	listmount			sys_listmount
++459	common	lsm_get_self_attr		sys_lsm_get_self_attr
++460	common	lsm_set_self_attr		sys_lsm_set_self_attr
++461	common	lsm_list_modules		sys_lsm_list_modules
diff --cc include/uapi/asm-generic/unistd.h
index b67b18e71fbd,55cc0bcfb58d..000000000000
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@@ -829,14 -829,15 +829,21 @@@ __SYSCALL(__NR_futex_wait, sys_futex_wa
  #define __NR_futex_requeue 456
  __SYSCALL(__NR_futex_requeue, sys_futex_requeue)
  
 -#define __NR_lsm_get_self_attr 457
 +#define __NR_statmount   457
 +__SYSCALL(__NR_statmount, sys_statmount)
 +
 +#define __NR_listmount   458
 +__SYSCALL(__NR_listmount, sys_listmount)
 +
++#define __NR_lsm_get_self_attr 459
+ __SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr)
 -#define __NR_lsm_set_self_attr 458
++#define __NR_lsm_set_self_attr 460
+ __SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)
 -#define __NR_lsm_list_modules 459
++#define __NR_lsm_list_modules 461
+ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
+ 
  #undef __NR_syscalls
- #define __NR_syscalls 459
 -#define __NR_syscalls 460
++#define __NR_syscalls 462
  
  /*
   * 32 bit systems traditionally used different

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the security tree with the vfs-brauner tree
  2023-11-20  3:31 linux-next: manual merge of the security tree with the vfs-brauner tree Stephen Rothwell
@ 2023-11-20 21:09 ` Paul Moore
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Moore @ 2023-11-20 21:09 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christian Brauner, Casey Schaufler, Linux Kernel Mailing List,
	Linux Next Mailing List, Miklos Szeredi

On Sun, Nov 19, 2023 at 10:31 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the security tree got conflicts in:
>
>   arch/alpha/kernel/syscalls/syscall.tbl
>   arch/arm/tools/syscall.tbl
>   arch/arm64/include/asm/unistd32.h
>   arch/m68k/kernel/syscalls/syscall.tbl
>   arch/microblaze/kernel/syscalls/syscall.tbl
>   arch/mips/kernel/syscalls/syscall_n32.tbl
>   arch/mips/kernel/syscalls/syscall_n64.tbl
>   arch/mips/kernel/syscalls/syscall_o32.tbl
>   arch/parisc/kernel/syscalls/syscall.tbl
>   arch/powerpc/kernel/syscalls/syscall.tbl
>   arch/s390/kernel/syscalls/syscall.tbl
>   arch/sh/kernel/syscalls/syscall.tbl
>   arch/sparc/kernel/syscalls/syscall.tbl
>   arch/x86/entry/syscalls/syscall_32.tbl
>   arch/x86/entry/syscalls/syscall_64.tbl
>   arch/xtensa/kernel/syscalls/syscall.tbl
>   include/uapi/asm-generic/unistd.h
>
> between commit:
>
>   9fa5392c080e ("wire up syscalls for statmount/listmount")
>
> from the vfs-brauner tree and commit:
>
>   5f42375904b0 ("LSM: wireup Linux Security Module syscalls")
>
> from the security tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Thanks Stephen.

-- 
paul-moore.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the security tree with the vfs-brauner tree
@ 2024-09-10  3:27 Stephen Rothwell
  2024-09-10 19:45 ` Paul Moore
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2024-09-10  3:27 UTC (permalink / raw)
  To: Paul Moore, Christian Brauner
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Mickaël Salaün

[-- Attachment #1: Type: text/plain, Size: 3071 bytes --]

Hi all,

Today's linux-next merge of the security tree got a conflict in:

  fs/fcntl.c

between commit:

  1934b212615d ("file: reclaim 24 bytes from f_owner")

from the vfs-brauner tree and commit:

  26f204380a3c ("fs: Fix file_set_fowner LSM hook inconsistencies")

from the security tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/fcntl.c
index f6fde75a3bd5,c28dc6c005f1..000000000000
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@@ -89,72 -87,24 +89,66 @@@ static int setfl(int fd, struct file * 
  	return error;
  }
  
 +/*
 + * Allocate an file->f_owner struct if it doesn't exist, handling racing
 + * allocations correctly.
 + */
 +int file_f_owner_allocate(struct file *file)
 +{
 +	struct fown_struct *f_owner;
 +
 +	f_owner = file_f_owner(file);
 +	if (f_owner)
 +		return 0;
 +
 +	f_owner = kzalloc(sizeof(struct fown_struct), GFP_KERNEL);
 +	if (!f_owner)
 +		return -ENOMEM;
 +
 +	rwlock_init(&f_owner->lock);
 +	f_owner->file = file;
 +	/* If someone else raced us, drop our allocation. */
 +	if (unlikely(cmpxchg(&file->f_owner, NULL, f_owner)))
 +		kfree(f_owner);
 +	return 0;
 +}
 +EXPORT_SYMBOL(file_f_owner_allocate);
 +
 +void file_f_owner_release(struct file *file)
 +{
 +	struct fown_struct *f_owner;
 +
 +	f_owner = file_f_owner(file);
 +	if (f_owner) {
 +		put_pid(f_owner->pid);
 +		kfree(f_owner);
 +	}
 +}
 +
- static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
-                      int force)
+ void __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
+ 		int force)
  {
 -	write_lock_irq(&filp->f_owner.lock);
 -	if (force || !filp->f_owner.pid) {
 -		put_pid(filp->f_owner.pid);
 -		filp->f_owner.pid = get_pid(pid);
 -		filp->f_owner.pid_type = type;
 +	struct fown_struct *f_owner;
 +
 +	f_owner = file_f_owner(filp);
 +	if (WARN_ON_ONCE(!f_owner))
 +		return;
 +
 +	write_lock_irq(&f_owner->lock);
 +	if (force || !f_owner->pid) {
 +		put_pid(f_owner->pid);
 +		f_owner->pid = get_pid(pid);
 +		f_owner->pid_type = type;
  
  		if (pid) {
  			const struct cred *cred = current_cred();
+ 			security_file_set_fowner(filp);
 -			filp->f_owner.uid = cred->uid;
 -			filp->f_owner.euid = cred->euid;
 +			f_owner->uid = cred->uid;
 +			f_owner->euid = cred->euid;
  		}
  	}
 -	write_unlock_irq(&filp->f_owner.lock);
 +	write_unlock_irq(&f_owner->lock);
  }
- 
- void __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
- 		int force)
- {
- 	security_file_set_fowner(filp);
- 	f_modown(filp, pid, type, force);
- }
  EXPORT_SYMBOL(__f_setown);
  
  int f_setown(struct file *filp, int who, int force)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: linux-next: manual merge of the security tree with the vfs-brauner tree
  2024-09-10  3:27 Stephen Rothwell
@ 2024-09-10 19:45 ` Paul Moore
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Moore @ 2024-09-10 19:45 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christian Brauner, Linux Kernel Mailing List,
	Linux Next Mailing List, Mickaël Salaün

On Mon, Sep 9, 2024 at 11:27 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the security tree got a conflict in:
>
>   fs/fcntl.c
>
> between commit:
>
>   1934b212615d ("file: reclaim 24 bytes from f_owner")
>
> from the vfs-brauner tree and commit:
>
>   26f204380a3c ("fs: Fix file_set_fowner LSM hook inconsistencies")
>
> from the security tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell

Thanks Stephen, the fixup looked from from a LSM perspective.

-- 
paul-moore.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* linux-next: manual merge of the security tree with the vfs-brauner tree
@ 2026-04-06 14:05 Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-04-06 14:05 UTC (permalink / raw)
  To: Paul Moore
  Cc: Amir Goldstein, Christian Brauner, Linux Kernel Mailing List,
	Linux Next Mailing List, Mateusz Guzik

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

Hi all,

Today's linux-next merge of the security tree got a conflict in:

  fs/file_table.c

between commit:

  1f1651d6dc2ac ("fs: hide file and bfile caches behind runtime const machinery")

from the vfs-brauner tree and commit:

  fbec24706feb2 ("fs: prepare for adding LSM blob to backing_file")

from the security tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc fs/file_table.c
index c40ec1be28992,d19d879b6efc1..0000000000000
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@@ -70,6 -69,25 +73,25 @@@ void backing_file_set_user_path(struct 
  }
  EXPORT_SYMBOL_GPL(backing_file_set_user_path);
  
+ #ifdef CONFIG_SECURITY
+ void *backing_file_security(const struct file *f)
+ {
+ 	return backing_file(f)->security;
+ }
+ 
+ void backing_file_set_security(struct file *f, void *security)
+ {
+ 	backing_file(f)->security = security;
+ }
+ #endif /* CONFIG_SECURITY */
+ 
+ static inline void backing_file_free(struct backing_file *ff)
+ {
+ 	security_backing_file_free(&ff->file);
+ 	path_put(&ff->user_path);
 -	kmem_cache_free(bfilp_cachep, ff);
++	kmem_cache_free(bfilp_cache, ff);
+ }
+ 
  static inline void file_free(struct file *f)
  {
  	security_file_free(f);
@@@ -77,10 -95,9 +99,9 @@@
  		percpu_counter_dec(&nr_files);
  	put_cred(f->f_cred);
  	if (unlikely(f->f_mode & FMODE_BACKING)) {
- 		path_put(backing_file_user_path(f));
- 		kmem_cache_free(bfilp_cache, backing_file(f));
+ 		backing_file_free(backing_file(f));
  	} else {
 -		kmem_cache_free(filp_cachep, f);
 +		kmem_cache_free(filp_cache, f);
  	}
  }
  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-06 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20  3:31 linux-next: manual merge of the security tree with the vfs-brauner tree Stephen Rothwell
2023-11-20 21:09 ` Paul Moore
  -- strict thread matches above, loose matches on Subject: below --
2024-09-10  3:27 Stephen Rothwell
2024-09-10 19:45 ` Paul Moore
2026-04-06 14:05 Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox