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>] [day] [month] [year] [list]
Message-ID: <5ee80f4677884c0dace60bb63646a987@huawei.com>
Date:   Fri, 7 Aug 2020 09:48:16 +0000
From:   linmiaohe <linmiaohe@...wei.com>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
CC:     David Miller <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Florian Westphal <fw@...len.de>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Steffen Klassert <steffen.klassert@...unet.com>,
        "Jason A. Donenfeld" <Jason@...c4.com>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "decui@...rosoft.com" <decui@...rosoft.com>,
        Jakub Sitnicki <jakub@...udflare.com>,
        "jeremy@...zel.net" <jeremy@...zel.net>,
        "mashirle@...ibm.com" <mashirle@...ibm.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/5] net: Fix potential deadloop in skb_copy_ubufs()

Willem de Bruijn <willemdebruijn.kernel@...il.com> wrote:
>On Thu, Aug 6, 2020 at 1:48 PM linmiaohe <linmiaohe@...wei.com> wrote:
>>
>> From: Miaohe Lin <linmiaohe@...wei.com>
>>
>> We could be trapped in deadloop when we try to copy userspace skb 
>> frags buffers to kernel with a cloned skb:
>
>> Catch this unexpected case and return -EINVAL in skb_orphan_frags() 
>> before we call skb_copy_ubufs() to fix it.
>
>Is this a hypothetical codepath?
>
>skb zerocopy carefully tracks clone calls where necessary. See the call to skb_orphan_frags in skb_clone, and the implementation of that callee.
>
>The only caller of skb zerocopy with nouarg is tpacket_fill_skb, as of commit 5cd8d46ea156 ("packet: copy user buffers before orphan or clone").
>
>As the commit subject indicates, this sets skb_zcopy_set_nouarg exactly to be sure that any clone will trigger a copy of "zerocopy"
>user data to private kernel memory.
>
>No clone must happen between alloc_skb and skb_zcopy_set_nouarg, indeed. But AFAIK, none exists.

Many thanks for your reply and explaination. As you say, this is a hypothetical codepath. This would not be triggerd normally.
I catch this suspicious patch just in case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ