Re: [RFC PATCH v5 0/7] mseal system mappings

2025-02-12 Thread Pedro Falcato
On Wed, Feb 12, 2025 at 11:25 AM Lorenzo Stoakes wrote: > > On Wed, Feb 12, 2025 at 03:21:48AM +, jef...@chromium.org wrote: > > From: Jeff Xu > > > > The commit message in the first patch contains the full description of > > this series. > > Sorry to nit, but it'd be useful to reproduce in t

Re: [RFC PATCH v5 0/7] mseal system mappings

2025-02-12 Thread Lorenzo Stoakes
(sorry I really am struggling to reply to mail as lore still seems to be broken). On Wed, Feb 12, 2025 at 12:37:50PM +, Pedro Falcato wrote: > On Wed, Feb 12, 2025 at 11:25 AM Lorenzo Stoakes > wrote: > > > > On Wed, Feb 12, 2025 at 03:21:48AM +, jef...@chromium.org wrote: > > > From: Jef

Re: [RFC PATCH v5 0/7] mseal system mappings

2025-02-12 Thread Johannes Berg
On Wed, 2025-02-12 at 14:01 +, Lorenzo Stoakes wrote: > Thanks, yeah that's a good point, it would have to be implemented as a > personality or something similar otherwise you're essentially relying on > 'unsealing' which can't be permitted. > > I'm not sure how useful that'd be for the likes

[PATCH net-next v2] net: Add options as a flexible array to struct ip_tunnel_info

2025-02-12 Thread Gal Pressman
Remove the hidden assumption that options are allocated at the end of the struct, and teach the compiler about them using a flexible array. With this, we can revert the unsafe_memcpy() call we have in tun_dst_unclone() [1], and resolve the false field-spanning write warning caused by the memcpy()

Re: [RFC PATCH v5 2/7] selftests: x86: test_mremap_vdso: skip if vdso is msealed

2025-02-12 Thread Thomas Weißschuh
On Wed, Feb 12, 2025 at 03:21:50AM +, jef...@chromium.org wrote: > From: Jeff Xu > > Add code to detect if the vdso is memory sealed, skip the test > if it is. > > Signed-off-by: Jeff Xu > --- > .../testing/selftests/x86/test_mremap_vdso.c | 38 +++ > 1 file changed, 38 in

Re: [RFC PATCH v5 1/7] mseal, system mappings: kernel config and header change

2025-02-12 Thread Liam R. Howlett
* jef...@chromium.org [250211 22:22]: > From: Jeff Xu > > Provide infrastructure to mseal system mappings. Establish > two kernel configs (CONFIG_MSEAL_SYSTEM_MAPPINGS, > ARCH_HAS_MSEAL_SYSTEM_MAPPINGS) and a header file (userprocess.h) > for future patches. > > As discussed during mseal() upst

Re: [PATCH v3 0/2] Refine kmalloc caches randomization in kvmalloc

2025-02-12 Thread Harry Yoo
On Wed, Feb 12, 2025 at 04:15:03PM +0800, GONG Ruiqi wrote: > Hi, > > v3: > - move all the way from kmalloc_gfp_adjust to kvrealloc_noprof into > mm/slub.c > - some rewording for commit logs > v2: > https://lore.kernel.org/all/20250208014723.1514049-1-gongrui...@huawei.com/ > - change t

Re: [PATCH v3 0/2] Refine kmalloc caches randomization in kvmalloc

2025-02-12 Thread Vlastimil Babka
On 2/12/25 15:20, Harry Yoo wrote: > On Wed, Feb 12, 2025 at 04:15:03PM +0800, GONG Ruiqi wrote: >> Hi, >> >> v3: >> - move all the way from kmalloc_gfp_adjust to kvrealloc_noprof into >> mm/slub.c >> - some rewording for commit logs >> v2: >> https://lore.kernel.org/all/20250208014723.15

Re: [PATCH v3 0/2] Refine kmalloc caches randomization in kvmalloc

2025-02-12 Thread Vlastimil Babka
On 2/12/25 09:15, GONG Ruiqi wrote: > Hi, > > v3: > - move all the way from kmalloc_gfp_adjust to kvrealloc_noprof into > mm/slub.c > - some rewording for commit logs > v2: > https://lore.kernel.org/all/20250208014723.1514049-1-gongrui...@huawei.com/ > - change the implementation as Vla

Re: [RFC PATCH v5 0/7] mseal system mappings

2025-02-12 Thread Lorenzo Stoakes
On Wed, Feb 12, 2025 at 03:21:48AM +, jef...@chromium.org wrote: > From: Jeff Xu > > The commit message in the first patch contains the full description of > this series. Sorry to nit, but it'd be useful to reproduce in the cover letter too! But this obviously isn't urgent, just be nice when

Re: [PATCH v2 6/6] unicode: kunit: change tests filename and path

2025-02-12 Thread Gabriel Krisman Bertazi
Kees Cook writes: > From: Gabriela Bittencourt > > Change utf8 kunit test filename and path to follow the style > convention on Documentation/dev-tools/kunit/style.rst > > Co-developed-by: Pedro Orlando > Signed-off-by: Pedro Orlando > Co-developed-by: Danilo Pereira > Signed-off-by: Danilo P

Re: [RFC] Circumventing FineIBT Via Entrypoints

2025-02-12 Thread Jennifer Miller
On Wed, Feb 12, 2025 at 11:29:02PM +0100, Jann Horn wrote: > +Andy Lutomirski (X86 entry code maintainer) > > On Wed, Feb 12, 2025 at 10:08 PM Jennifer Miller wrote: > > As part of a recently accepted paper we demonstrated that syscall > > entrypoints can be misused on x86-64 systems to generical

Re: [RFC] Circumventing FineIBT Via Entrypoints

2025-02-12 Thread Andrew Cooper
On 13/02/2025 2:09 am, Jann Horn wrote: > On Thu, Feb 13, 2025 at 2:31 AM Andrew Cooper > wrote: Assuming this is an issue you all feel is worth addressing, I will continue working on providing a patch. I'm concerned though that the overhead from adding a wrmsr on both syscall entr

[PATCH][next] UAPI: ndctl / acpi: intel: Avoid multiple -Wflex-array-member-not-at-end warnings

2025-02-12 Thread Gustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. So, in order to avoid ending up with flexible-array members in the middle of other structs, we use the `__struct_group()` helper to separate the flexible array from the rest of the members in

Re: [PATCH 00/10] Annotate arguments of memtostr/strtomem with __nonstring

2025-02-12 Thread Martin K. Petersen
Kees, > The memtostr*() and strtomem*() helpers are designed to move between C > strings (NUL-terminated) and byte arrays (that may just be zero padded > and may not be NUL-terminated). The "nonstring" attribute is used to > annotated these kinds of byte arrays, and we can validate the > annotat

Re: [PATCH net-next v2] net: Add options as a flexible array to struct ip_tunnel_info

2025-02-12 Thread Gal Pressman
On 12/02/2025 18:29, Alexander Lobakin wrote: > From: Gal Pressman > Date: Wed, 12 Feb 2025 16:09:53 +0200 > >> Remove the hidden assumption that options are allocated at the end of >> the struct, and teach the compiler about them using a flexible array. > > [...] > >> diff --git a/include/net/

[RFC] Circumventing FineIBT Via Entrypoints

2025-02-12 Thread Jennifer Miller
Hi All, As part of a recently accepted paper we demonstrated that syscall entrypoints can be misused on x86-64 systems to generically bypass FineIBT/KERNEL_IBT from forwards-edge control flow hijacking. We communicated this finding to s@k.o before submitting the paper and were encouraged to bring

Re: [PATCH net-next v2] net: Add options as a flexible array to struct ip_tunnel_info

2025-02-12 Thread Alexander Lobakin
From: Gal Pressman Date: Wed, 12 Feb 2025 16:09:53 +0200 > Remove the hidden assumption that options are allocated at the end of > the struct, and teach the compiler about them using a flexible array. [...] > diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h > index 84c154029

Re: [RFC] Circumventing FineIBT Via Entrypoints

2025-02-12 Thread Jann Horn
+Andy Lutomirski (X86 entry code maintainer) On Wed, Feb 12, 2025 at 10:08 PM Jennifer Miller wrote: > As part of a recently accepted paper we demonstrated that syscall > entrypoints can be misused on x86-64 systems to generically bypass > FineIBT/KERNEL_IBT from forwards-edge control flow hijack

[PATCH] scsi: hpsa: Replace deprecated strncpy() with strscpy_pad()

2025-02-12 Thread Thorsten Blum
strncpy() is deprecated for NUL-terminated destination buffers [1]. Replace memset() and strncpy() with strscpy_pad() to copy the version string and fill the remaining bytes in the destination buffer with NUL bytes. This avoids zeroing the memory before copying the string. Compile-tested only. L

[PATCH v3 2/2] slab: Achieve better kmalloc caches randomization in kvmalloc

2025-02-12 Thread GONG Ruiqi
As revealed by this writeup[1], due to the fact that __kmalloc_node (now renamed to __kmalloc_node_noprof) is an exported symbol and will never get inlined, using it in kvmalloc_node (now is __kvmalloc_node_noprof) would make the RET_IP inside always point to the same address: upper_caller

[PATCH v3 1/2] slab: Adjust placement of __kvmalloc_node_noprof

2025-02-12 Thread GONG Ruiqi
Move __kvmalloc_node_noprof (as well as kvfree*, kvrealloc_noprof and kmalloc_gfp_adjust for consistency) into mm/slub.c so that it can directly invoke __do_kmalloc_node, which is needed for the next patch. No functional changes intended. Signed-off-by: GONG Ruiqi --- mm/slub.c | 162 ++

[PATCH v3 0/2] Refine kmalloc caches randomization in kvmalloc

2025-02-12 Thread GONG Ruiqi
Hi, v3: - move all the way from kmalloc_gfp_adjust to kvrealloc_noprof into mm/slub.c - some rewording for commit logs v2: https://lore.kernel.org/all/20250208014723.1514049-1-gongrui...@huawei.com/ - change the implementation as Vlastimil suggested v1: https://lore.kernel.org/all/202501

Re: [PATCH] net/mlx4_core: Avoid impossible mlx4_db_alloc() order value

2025-02-12 Thread Justin Stitt
On Tue, Feb 11, 2025 at 6:22 AM Tariq Toukan wrote: > > > > On 11/02/2025 2:01, Justin Stitt wrote: > > On Mon, Feb 10, 2025 at 09:45:05AM -0800, Kees Cook wrote: > >> GCC can see that the value range for "order" is capped, but this leads > >> it to consider that it might be negative, leading to a

Re: [PATCH net-next v2] net: Add options as a flexible array to struct ip_tunnel_info

2025-02-12 Thread Jakub Kicinski
On Wed, 12 Feb 2025 20:13:28 +0200 Gal Pressman wrote: > > You could leave this macro inplace and just change `(info) + 1` to > > `(info)->options` avoiding changes in lots of files and adding casts > > everywhere. +1 > I'd rather not, having a macro to do 'info->options' doesn't help code > re

Re: [RFC] Circumventing FineIBT Via Entrypoints

2025-02-12 Thread Jann Horn
On Thu, Feb 13, 2025 at 2:31 AM Andrew Cooper wrote: > >> Assuming this is an issue you all feel is worth addressing, I will > >> continue working on providing a patch. I'm concerned though that the > >> overhead from adding a wrmsr on both syscall entry and exit to > >> overwrite and restore the

Re: [RFC] Circumventing FineIBT Via Entrypoints

2025-02-12 Thread Andrew Cooper
>> Assuming this is an issue you all feel is worth addressing, I will >> continue working on providing a patch. I'm concerned though that the >> overhead from adding a wrmsr on both syscall entry and exit to >> overwrite and restore the KERNEL_GS_BASE MSR may be quite high, so >> any feedback in re

RE: [PATCH] wifi: ath12k: Fix uninitialized variable and remove goto

2025-02-12 Thread Ping-Ke Shih
Jeff Johnson wrote: > On 2/10/2025 8:09 PM, Ping-Ke Shih wrote: > > Addresses-Coverity-ID: 1642337 ("Uninitialized scalar variable") > >>> > >>> Is that an official kernel tag? IMO the proper tag would be > >> So, it isn't "official" as far as I can tell, but it is widely used in > >> ot

Re: [PATCH v2] wifi: ath12k: cleanup ath12k_mac_mlo_ready()

2025-02-12 Thread Jeff Johnson
On 2/10/2025 6:49 PM, Ethan Carter Edwards wrote: > There is a possibility for an uninitialized *ret* variable to be > returned in some code paths. > > This explicitly returns 0 without an error. Also removes goto that > returned *ret* and simply returns in place. > > Closes: > https://scan5.sca

[PATCH] scsi: hpsa: Replace deprecated strncpy() with strscpy()

2025-02-12 Thread Thorsten Blum
strncpy() is deprecated for NUL-terminated destination buffers [1]. Use strscpy() instead and remove the manual NUL-termination. Use min() to simplify the size calculation. Compile-tested only. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-string

Re: [PATCH] wifi: ath12k: Fix uninitialized variable and remove goto

2025-02-12 Thread Jeff Johnson
On 2/10/2025 8:09 PM, Ping-Ke Shih wrote: Addresses-Coverity-ID: 1642337 ("Uninitialized scalar variable") >>> >>> Is that an official kernel tag? IMO the proper tag would be >> So, it isn't "official" as far as I can tell, but it is widely used in >> other commits, especially by Gustavo

Re: [PATCH v2 6/6] unicode: kunit: change tests filename and path

2025-02-12 Thread Kees Cook
On Wed, Feb 12, 2025 at 10:40:34AM -0500, Gabriel Krisman Bertazi wrote: > Kees Cook writes: > > > From: Gabriela Bittencourt > > > > Change utf8 kunit test filename and path to follow the style > > convention on Documentation/dev-tools/kunit/style.rst > > > > Co-developed-by: Pedro Orlando > >

Re: [RFC PATCH v5 0/7] mseal system mappings

2025-02-12 Thread Kees Cook
On Wed, Feb 12, 2025 at 11:24:35AM +, Lorenzo Stoakes wrote: > On Wed, Feb 12, 2025 at 03:21:48AM +, jef...@chromium.org wrote: > > From: Jeff Xu > > > > The commit message in the first patch contains the full description of > > this series. > > Sorry to nit, but it'd be useful to reprodu