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

2025-01-25 Thread GONG Ruiqi
On 2025/01/24 23:19, Vlastimil Babka wrote: > On 1/22/25 17:02, Christoph Lameter (Ampere) wrote: >> On Wed, 22 Jan 2025, GONG Ruiqi wrote: >> >>> >>> +void *__kmalloc_node_inline(size_t size, kmem_buckets *b, gfp_t flags, >>> + int node, unsigned long caller); >>> + >>

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

2025-01-24 Thread Vlastimil Babka
On 1/22/25 17:02, Christoph Lameter (Ampere) wrote: > On Wed, 22 Jan 2025, GONG Ruiqi wrote: > >> >> +void *__kmalloc_node_inline(size_t size, kmem_buckets *b, gfp_t flags, >> +int node, unsigned long caller); >> + > > > Huh? Is this inline? Where is the body of the f

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

2025-01-22 Thread Christoph Lameter (Ampere)
On Wed, 22 Jan 2025, GONG Ruiqi wrote: > > +void *__kmalloc_node_inline(size_t size, kmem_buckets *b, gfp_t flags, > + int node, unsigned long caller); > + Huh? Is this inline? Where is the body of the function? > diff --git a/mm/slub.c b/mm/slub.c > index c2151c9fee

[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