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: <b5c23b42-80ae-c45d-e1e0-2a54f04daf45@redhat.com>
Date:   Thu, 18 Jan 2018 17:14:25 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc:     Network Development <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Willem de Bruijn <willemb@...gle.com>,
        Vlad Yasevic <vyasevic@...hat.com>
Subject: Re: [PATCH net] gso: validate gso_type if SKB_GSO_DODGY



On 2018年01月18日 14:04, Willem de Bruijn wrote:
> 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.

As you mentioned below, looks like we can e.g bridge between tunnels 
(vxlan, gre or others) and tap, or even bpf can produce this (e.g 
bpf_skb_adjust_room).

>
> virtio_net_hdr_to_skb does not accept tunneled gso types.

Yes, Vlad is trying to extend virtio to support more kinds of gso types, 
so it will be supported for sure.

>
> 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.

I think so.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ