lkml.org 
[lkml]   [2020]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: KASAN: slab-out-of-bounds Read in __nla_put_nohdr
From
Date


On 1/22/20 12:27 PM, Cong Wang wrote:
> On Tue, Jan 21, 2020 at 11:55 AM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> em_nbyte_change() sets
>> em->datalen = sizeof(*nbyte) + nbyte->len;
>>
>> But later tcf_em_validate() overwrites em->datalen with the user provide value (em->datalen = data_len; )
>> which can be bigger than the allocated (kmemdup) space in em_nbyte_change()
>>
>> Should net/sched/em_nbyte.c() provide a dump() handler to avoid this issue ?
>
> I think for those who implement ->change() we should leave
> ->datalen untouched to respect their choices. I don't see why
> we have to set it twice.
>
>

Agreed, but we need to audit them to make sure all of them are setting ->datalen

\
 
 \ /
  Last update: 2020-01-22 21:34    [W:0.047 / U:1.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site