lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-LOKbk3A_JOBqsAAJikGWN35dC3hJopHmgnq2eH+5Ksog@mail.gmail.com>
Date:   Thu, 18 Jan 2018 01:04:48 -0500
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Jason Wang <jasowang@...hat.com>
Cc:     Network Development <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] gso: validate gso_type if SKB_GSO_DODGY

On Thu, Jan 18, 2018 at 12:20 AM, Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
> On Wed, Jan 17, 2018 at 10:48 PM, Jason Wang <jasowang@...hat.com> wrote:
>>
>>
>> On 2018年01月18日 07:11, Willem de Bruijn wrote:
>>>
>>> From: Willem de Bruijn<willemb@...gle.com>
>>>
>>> Validate gso_type of untrusted SKB_GSO_DODGY packets during
>>> segmentation.
>>>
>>> Untrusted user packets are limited to a small set of gso types in
>>> virtio_net_hdr_to_skb. But segmentation occurs on packet contents.
>>> Syzkaller was able to enter gso callbacks that are not hardened
>>> against untrusted user input.
>>>
>>> Fixes: f43798c27684 ("tun: Allow GSO using virtio_net_hdr")
>>
>>
>> This commit is suspicious, I guess it should be 5c7cdf339af5 ("gso: Remove
>> arbitrary checks for unsupported GSO")
>
> The specific SCTP path was introduced with commit 90017accff61 ("sctp:
> add GSO support"). But the main issue that packets can be delivered to
> gso handlers different from their gso_type goes back further.
>
> The commit you reference is actually older than the sctp gso patch, so
> it makes sense that it did not have a check in the sctp_gso_segment.
>
> I still think that we should check in inet_gso_segment when we have
> the proto, instead of in each {tcp, sctp, udp, esp, ...} handler having
> a check of the form.
>
>       !(type & (SKB_GSO_TCPV4 |
>         SKB_GSO_TCPV6))))

Unless we can create packets that legitimate combine
SKB_GSO_DODGY with tunnel headers.

virtio_net_hdr_to_skb does not accept tunneled gso types.

But a tun device can be bridged with a gre tunnel in the
host, creating a path that will call gre_gso_segment.

If that is possible, then this patch is indeed too strict and
we do need checks in the individual handlers.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ