[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1459214222.6473.144.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Mon, 28 Mar 2016 18:17:02 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: jengelh@...i.de, kadlec@...ckhole.kfki.hu, sploving1@...il.com,
pablo@...filter.org, kaber@...sh.net,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: BUG: net/netfilter: KASAN: stack-out-of-bounds in tcp_packet
On Mon, 2016-03-28 at 19:54 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@...il.com>
> Date: Mon, 28 Mar 2016 13:51:46 -0700
>
> > On Mon, 2016-03-28 at 13:46 -0700, Eric Dumazet wrote:
> >
> >> We have at least 384 bytes of padding in skb->head (this is struct
> >> skb_shared_info).
> >>
> >> Whatever garbage we might read, current code is fine.
> >>
> >> We have to deal with a false positive here.
> >
> > Very similar to the one fixed in
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=10ec9472f05b45c94db3c854d22581a20b97db41
>
> I don't see them as similar.
>
> The current options code we are talking about here never references
> past legitimate parts of the packet data. We always check 'length',
> and we never access past the boundary it describes.
>
> This was the entire point of my posting.
>
> Talking about padding, rather than the logical correctness of the
> code, is therefore a distraction I think :-)
Not really, we do read one out of bound byte David.
length = 1;
...
while (length > 0) {
int opcode = *ptr++; // Note that length is still 1
switch (opcode) {
...
default:
opsize = *ptr++; // Note that length is still 1
...
length -= opsize;
}
So we do read 2 bytes, while length was 1.
opsize definitely can read garbage.
Call it padding or redzone or whatever ;)
Powered by blists - more mailing lists