lkml.org 
[lkml]   [2023]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] mm/slub: remove freelist_dereference()
From
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>
>>
>

\
 
 \ /
  Last update: 2023-07-16 20:48    [W:0.079 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site