linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Kees Cook <keescook@chromium.org>
Cc: Christoph Lameter <cl@linux.com>,
	David Rientjes <rientjes@google.com>,
	Pekka Enberg <penberg@kernel.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org, patches@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Matteo Rizzo <matteorizzo@google.com>,
	Jann Horn <jannh@google.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	Marco Elver <elver@google.com>,
	Alexander Potapenko <glider@google.com>,
	kasan-dev@googlegroups.com, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/slub: remove freelist_dereference()
Date: Fri, 14 Jul 2023 10:01:15 +0200	[thread overview]
Message-ID: <7c33a6c3-4ded-e0e4-820d-ffc337da9800@suse.cz> (raw)
In-Reply-To: <b18ca2ce-5ebc-1a38-bb9d-a8bb9070cdb1@suse.cz>

On 7/13/23 09:44, Vlastimil Babka wrote:
> On 7/11/23 18:21, Kees Cook wrote:
>> On Tue, Jul 11, 2023 at 03:46:25PM +0200, Vlastimil Babka wrote:
>>>  
>>>  #ifndef CONFIG_SLUB_TINY
>>> -- 
>>> 2.41.0
>>> 
>> 
>> I like reducing the complexity here, but I find dropping the "object"
>> reassignment makes this a bit harder to read. What about:
> 
> Alright.
> 
>> 	object = kasan_reset_tag(object);
>> 	unsigned long ptr_addr = (unsigned long)object + s->offset;
>> 	freeptr_t p = *(freeptr_t *)(ptr_addr);
> 
> Are we really so benevolent with declaration-after-statement now? :)

I've left the declarations separate for now so it's similar to
get_freepointer_safe(). Pushed the result to slab/for-6.6/cleanup and
for-next. Thanks for the reviews!

>> 	return freelist_ptr_decode(s, p, ptr_addr);
>> 
>> ?
>> 
>> They're the same result, so either way:
>> 
>> Acked-by: Kees Cook <keescook@chromium.org>
>> 
> 



  reply	other threads:[~2023-07-14  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 13:46 [PATCH 1/2] mm/slub: remove redundant kasan_reset_tag() from freelist_ptr calculations Vlastimil Babka
2023-07-11 13:46 ` [PATCH 2/2] mm/slub: remove freelist_dereference() Vlastimil Babka
2023-07-11 16:21   ` Kees Cook
2023-07-13  7:44     ` Vlastimil Babka
2023-07-14  8:01       ` Vlastimil Babka [this message]
2023-07-11 16:14 ` [PATCH 1/2] mm/slub: remove redundant kasan_reset_tag() from freelist_ptr calculations Kees Cook
2023-07-12 16:23 ` Andrey Konovalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c33a6c3-4ded-e0e4-820d-ffc337da9800@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=andreyknvl@google.com \
    --cc=cl@linux.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jannh@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matteorizzo@google.com \
    --cc=patches@lists.linux.dev \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox