Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-07 Thread Kent Overstreet
On Thu, Feb 06, 2025 at 10:11:29AM -0800, Kees Cook wrote: > In preparation for adding stricter type checking to the str/mem*() > helpers, provide a way to check that a variable is a character array > via __must_be_char_array(). > > Signed-off-by: Kees Cook > --- > include/linux/compiler.h | 8 +

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-06 Thread Kent Overstreet
On Thu, Feb 06, 2025 at 10:11:29AM -0800, Kees Cook wrote: > In preparation for adding stricter type checking to the str/mem*() > helpers, provide a way to check that a variable is a character array > via __must_be_char_array(). > > Signed-off-by: Kees Cook Suggested-by? :) > --- > include/lin

Re: [PATCH v3 2/6] mm/slab: Plumb kmem_buckets into __do_kmalloc_node()

2024-05-31 Thread Kent Overstreet
On Fri, May 31, 2024 at 09:48:49AM -0700, Kees Cook wrote: > On Fri, May 24, 2024 at 11:01:40AM -0400, Kent Overstreet wrote: > > On Wed, Apr 24, 2024 at 02:40:59PM -0700, Kees Cook wrote: > > > To be able to choose which buckets to allocate from, make the buckets > >

Re: [PATCH v3 2/6] mm/slab: Plumb kmem_buckets into __do_kmalloc_node()

2024-05-31 Thread Kent Overstreet
On Fri, May 31, 2024 at 09:48:49AM -0700, Kees Cook wrote: > On Fri, May 24, 2024 at 11:01:40AM -0400, Kent Overstreet wrote: > > On Wed, Apr 24, 2024 at 02:40:59PM -0700, Kees Cook wrote: > > > To be able to choose which buckets to allocate from, make the buckets > >

Re: [PATCH v3 2/6] mm/slab: Plumb kmem_buckets into __do_kmalloc_node()

2024-05-24 Thread Kent Overstreet
On Wed, Apr 24, 2024 at 02:40:59PM -0700, Kees Cook wrote: > To be able to choose which buckets to allocate from, make the buckets > available to the lower level kmalloc interfaces by adding them as the > first argument. Where the bucket is not available, pass NULL, which means > "use the default s

Re: [PATCH v3 0/6] slab: Introduce dedicated bucket allocator

2024-05-24 Thread Kent Overstreet
On Wed, Apr 24, 2024 at 02:40:57PM -0700, Kees Cook wrote: > Hi, > > Series change history: > > v3: > - clarify rationale and purpose in commit log > - rebase to -next (CONFIG_CODE_TAGGING) > - simplify calling styles and split out bucket plumbing more cleanly > - consolidate kmem_bucket

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-26 Thread Kent Overstreet
On Fri, Apr 26, 2024 at 10:32:27AM +0200, Pavel Machek wrote: > Hi! > > > > > > > The /proc/allocinfo file exposes a tremendous about of information > > > > > > about > > > > > > kernel build details, memory allocations (obviously), and > > > > > > potentially > > > > > > even image layout (due

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Fri, Apr 26, 2024 at 04:25:40AM +0100, Matthew Wilcox wrote: > On Thu, Apr 25, 2024 at 08:58:34PM -0400, Kent Overstreet wrote: > > On Thu, Apr 25, 2024 at 05:43:33PM -0700, Kees Cook wrote: > > > All this said, I'm still not excited about any of these files living >

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 05:43:33PM -0700, Kees Cook wrote: > On Thu, Apr 25, 2024 at 08:27:05PM -0400, Kent Overstreet wrote: > > On Thu, Apr 25, 2024 at 04:47:18PM -0700, Andrew Morton wrote: > > > On Thu, 25 Apr 2024 15:42:30 -0700 Kees Cook > > > wrote: > &g

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 04:47:18PM -0700, Andrew Morton wrote: > On Thu, 25 Apr 2024 15:42:30 -0700 Kees Cook wrote: > > > > The concern about leaking image layout could be addressed by sorting the > > > output before returning to userspace. > > > > It's trivial to change permissions from the de

Re: [PATCH] mm/slub: Avoid recursive loop with kmemleak

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 04:49:17PM -0700, Andrew Morton wrote: > On Thu, 25 Apr 2024 14:30:55 -0700 Suren Baghdasaryan > wrote: > > > > > --- a/mm/kmemleak.c > > > > +++ b/mm/kmemleak.c > > > > @@ -463,7 +463,7 @@ static struct kmemleak_object *mem_pool_alloc(gfp_t > > > > gfp) > > > > > > > >

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 03:42:30PM -0700, Kees Cook wrote: > On Thu, Apr 25, 2024 at 05:04:47PM -0400, Kent Overstreet wrote: > > On Thu, Apr 25, 2024 at 09:51:56PM +0100, Matthew Wilcox wrote: > > > On Thu, Apr 25, 2024 at 04:45:51PM -0400, Kent Overstreet wrote: > > >

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 02:38:42PM -0700, Andrew Morton wrote: > On Thu, 25 Apr 2024 14:21:39 -0700 Suren Baghdasaryan > wrote: > > > > > > The side effect of locking down more and more reporting interfaces is > > > > > that programs that consume those interfaces now have to run as root. > > > >

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 02:21:39PM -0700, Suren Baghdasaryan wrote: > On Thu, Apr 25, 2024 at 2:04 PM Kent Overstreet > wrote: > > > > On Thu, Apr 25, 2024 at 09:51:56PM +0100, Matthew Wilcox wrote: > > > On Thu, Apr 25, 2024 at 04:45:51PM -0400, Kent Overstreet wr

Re: [PATCH] mm/slub: Avoid recursive loop with kmemleak

2024-04-25 Thread Kent Overstreet
. > > Fixes: 279bb991b4d9 ("mm/slab: add allocation accounting into slab allocation > and free paths") > Signed-off-by: Kees Cook > --- > Cc: Suren Baghdasaryan > Cc: Kent Overstreet > Cc: Catalin Marinas > Cc: Andrew Morton > Cc: Christoph Lameter >

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 09:51:56PM +0100, Matthew Wilcox wrote: > On Thu, Apr 25, 2024 at 04:45:51PM -0400, Kent Overstreet wrote: > > On Thu, Apr 25, 2024 at 01:08:50PM -0700, Kees Cook wrote: > > > The /proc/allocinfo file exposes a tremendous about of information about

Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo

2024-04-25 Thread Kent Overstreet
On Thu, Apr 25, 2024 at 01:08:50PM -0700, Kees Cook wrote: > The /proc/allocinfo file exposes a tremendous about of information about > kernel build details, memory allocations (obviously), and potentially > even image layout (due to ordering). As this is intended to be consumed > by system owners

Re: [PATCH v2 4/9] slab: Introduce kmem_buckets_create()

2024-03-25 Thread Kent Overstreet
On Mon, Mar 25, 2024 at 01:40:34PM -0700, Kees Cook wrote: > On Mon, Mar 25, 2024 at 03:40:51PM -0400, Kent Overstreet wrote: > > On Tue, Mar 05, 2024 at 02:10:20AM -0800, Kees Cook wrote: > > > Dedicated caches are available For fixed size allocations via > > >

Re: [PATCH v2 4/9] slab: Introduce kmem_buckets_create()

2024-03-25 Thread Kent Overstreet
On Tue, Mar 05, 2024 at 02:10:20AM -0800, Kees Cook wrote: > Dedicated caches are available For fixed size allocations via > kmem_cache_alloc(), but for dynamically sized allocations there is only > the global kmalloc API's set of buckets available. This means it isn't > possible to separate specif

Re: [PATCH v2 0/9] slab: Introduce dedicated bucket allocator

2024-03-25 Thread Kent Overstreet
On Mon, Mar 25, 2024 at 10:03:23AM +0100, Vlastimil Babka wrote: > On 3/5/24 11:10 AM, Kees Cook wrote: > > Hi, > > > > Repeating the commit logs for patch 4 here: > > > > Dedicated caches are available For fixed size allocations via > > kmem_cache_alloc(), but for dynamically sized alloc

Re: [PATCH v1 1/1] lib/string_helpers: Add flags param to string_get_size()

2024-02-29 Thread Kent Overstreet
On Thu, Feb 29, 2024 at 01:52:34PM -0800, Kees Cook wrote: > On Thu, 29 Feb 2024 22:52:30 +0200, Andy Shevchenko wrote: > > The new flags parameter allows controlling > > - Whether or not the units suffix is separated by a space, for > >compatibility with sort -h > > - Whether or not to appen

Re: [PATCH v1 1/1] lib/string_helpers: Add flags param to string_get_size()

2024-02-29 Thread Kent Overstreet
On Thu, Feb 29, 2024 at 10:52:30PM +0200, Andy Shevchenko wrote: > From: Kent Overstreet > > The new flags parameter allows controlling > - Whether or not the units suffix is separated by a space, for >compatibility with sort -h > - Whether or not to append a B suffix

Re: [PATCH 00/82] overflow: Refactor open-coded arithmetic wrap-around

2024-01-22 Thread Kent Overstreet
On Mon, Jan 22, 2024 at 04:26:35PM -0800, Kees Cook wrote: > Hi, > > In our continuing effort to eliminate root causes of flaws in the kernel, > this series is the start to providing a way to have sensible coverage > for catching unexpected arithmetic wrap-around. > > A quick word on language: wh

Re: linux-next: Tree for Sep 12 (bcachefs)

2023-09-19 Thread Kent Overstreet
On Thu, Sep 14, 2023 at 05:20:41PM -0700, Kees Cook wrote: > Because they're ambiguous and then the compiler can't do appropriate > bounds checking, compile-time diagnostics, etc. Maybe it's actually zero > sized, maybe it's not. Nothing stops them from being in the middle of > the structure so if