lkml.org 
[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] slub: Relocate freelist pointer to middle of object
Date
From: Christopher Lameter
> Sent: 08 March 2020 19:21

>
> On Thu, 5 Mar 2020, Kees Cook wrote:
>
> > Instead of having the freelist pointer at the very beginning of an
> > allocation (offset 0) or at the very end of an allocation (effectively
> > offset -sizeof(void *) from the next allocation), move it away from
> > the edges of the allocation and into the middle. This provides some
> > protection against small-sized neighboring overflows (or underflows),
> > for which the freelist pointer is commonly the target. (Large or well
> > controlled overwrites are much more likely to attack live object contents,
> > instead of attempting freelist corruption.)
>
> Sounds good. You could even randomize the position to avoid attacks on via
> the freelist pointer.

Random overwrites could be detected (fairly cheaply) by putting two
copies of the pointer into the same cacheline in the buffer.
Or better make the second one 'pointer xor constant'.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2020-03-11 15:48    [W:0.049 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site