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

2025-01-21 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

Re: [PATCH v4 22/30] context_tracking: Exit CT_STATE_IDLE upon irq/nmi entry

2025-01-21 Thread Sean Christopherson
On Wed, Jan 22, 2025, Frederic Weisbecker wrote: > Le Tue, Jan 14, 2025 at 06:51:35PM +0100, Valentin Schneider a écrit : > > ct_nmi_{enter, exit}() only touches the RCU watching counter and doesn't > > modify the actual CT state part context_tracking.state. This means that > > upon receiving an IR

Re: [PATCH v4 22/30] context_tracking: Exit CT_STATE_IDLE upon irq/nmi entry

2025-01-21 Thread Frederic Weisbecker
Le Tue, Jan 14, 2025 at 06:51:35PM +0100, Valentin Schneider a écrit : > ct_nmi_{enter, exit}() only touches the RCU watching counter and doesn't > modify the actual CT state part context_tracking.state. This means that > upon receiving an IRQ when idle, the CT_STATE_IDLE->CT_STATE_KERNEL > transit

Re: [PATCH] kbuild: Use -fzero-init-padding-bits=all

2025-01-21 Thread Nathan Chancellor
On Mon, Jan 20, 2025 at 04:36:53PM -0800, Kees Cook wrote: > Enable -fzero-init-padding-bits=all when available (GCC 15+). This will > correctly zero padding bits in structs and unions that might have been > left uninitialized, and will make sure there is no regression in union > initializations[1]

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-01-21 Thread Uladzislau Rezki
> > > > As noted before, we defer flushing for vmalloc. We have a lazy-threshold > > which can be exposed(if you need it) over sysfs for tuning. So, we can add > > it. > > > > In a CPU isolation / NOHZ_FULL context, isolated CPUs will be running a > single userspace application that will never en

Re: [PATCH v4 1/1] exec: seal system mappings

2025-01-21 Thread enh
On Fri, Jan 17, 2025 at 5:08 PM Liam R. Howlett wrote: > > * enh [250117 14:35]: > ... > > > > > as a maintainer of a different linux libc, i've long wanted a "tell me > > everything there is to know about this vma" syscall rather than having > > to parse /proc/maps... > > > > You mean an ioctl()

[PATCH] pstore/zone: fix return value for psz_init_zones

2025-01-21 Thread Eugen Hristev
psz_init_zones is not supposed to return NULL. It returns an errno, and its caller always checks for an errno to look for a problem. If the caller receives a NULL as a return, this code will go further without any errors: cxt->kpszs = psz_init_zones(PSTORE_TYPE_DMESG, &off,

Re: [PATCH v4 04/30] rcutorture: Make TREE04 use CONFIG_RCU_DYNTICKS_TORTURE

2025-01-21 Thread Frederic Weisbecker
Le Tue, Jan 14, 2025 at 06:51:17PM +0100, Valentin Schneider a écrit : > We now have an RCU_EXPERT config for testing small-sized RCU dynticks > counter: CONFIG_RCU_DYNTICKS_TORTURE. > > Modify scenario TREE04 to exercise to use this config in order to test a > ridiculously small counter (2 bits)

Re: [PATCH v4 03/30] rcu: Add a small-width RCU watching counter debug option

2025-01-21 Thread Frederic Weisbecker
Le Tue, Jan 14, 2025 at 06:51:16PM +0100, Valentin Schneider a écrit : > A later commit will reduce the size of the RCU watching counter to free up > some bits for another purpose. Paul suggested adding a config option to > test the extreme case where the counter is reduced to its minimum usable >

Re: [PATCH v2] treewide: const qualify ctl_tables where applicable

2025-01-21 Thread Alexander Gordeev
On Fri, Jan 10, 2025 at 03:16:08PM +0100, Joel Granados wrote: Hi Joel, > Add the const qualifier to all the ctl_tables in the tree except for > watchdog_hardlockup_sysctl, memory_allocation_profiling_sysctls, > loadpin_sysctl_table and the ones calling register_net_sysctl (./net, > drivers/inifi

Re: RFC design of device coredump collection on panic in Pstore

2025-01-21 Thread Eugen Hristev
On 5/16/23 23:55, Kees Cook wrote: > On Mon, May 08, 2023 at 09:21:00PM +0530, Mukesh Ojha wrote: >> 1. Device_coredump allocates some configurable contigous memory that can be >> controlled >>via CONFIG or bootargs and later registers for panic notifiers. >> 2. Notifier gets added. >> 3. P

Re: [PATCH 2/3] mm: security: Allow default HARDENED_USERCOPY to be set at compile time

2025-01-21 Thread Mel Gorman
On Mon, Jan 20, 2025 at 01:21:54PM -0800, Kees Cook wrote: > On Fri, Jan 17, 2025 at 01:03:36PM +, Mel Gorman wrote: > > HARDENED_USERCOPY defaults to on if enabled at compile time. Allow > > hardened_usercopy= default to be set at compile time similar to > > init_on_alloc= and init_on_free=. T

Re: [PATCH 1/3] mm: security: Move hardened usercopy under 'Kernel hardening options'

2025-01-21 Thread Mel Gorman
On Mon, Jan 20, 2025 at 01:10:44PM -0800, Kees Cook wrote: > On Fri, Jan 17, 2025 at 01:03:35PM +, Mel Gorman wrote: > > There is a submenu for 'Kernel hardening options' under "Security". > > Move HARDENED_USERCOPY under the hardening options as it is clearly > > related. > > > > Signed-off-b