[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160328.152959.1109841569654352040.davem@davemloft.net>
Date: Mon, 28 Mar 2016 15:29:59 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: kadlec@...ckhole.kfki.hu
Cc: 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
From: Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>
Date: Mon, 28 Mar 2016 18:48:51 +0200 (CEST)
>> > > @@ -3716,6 +3716,8 @@ void tcp_parse_options(const struct sk_buff *skb,
>> > > length--;
>> > > continue;
>> > > default:
>> > > + if (length < 2)
>> > > + return;
>> > > opsize = *ptr++;
>> > > if (opsize < 2) /* "silly options" */
>> > > return;
I'm trying to figure out how this can even matter.
If we are in the loop, length is at least one.
That means it is legal to read the opsize byte.
By the next check, opsize is at least 2.
And then the very next line in this code makes sure length >= opsize:
if (opsize > length)
return; /* don't parse partial options */
Therefore no out-of-range access is possible as far as I can see.
Powered by blists - more mailing lists