From: Eric Dumazet <edumazet@google.com>
To: Phillip Potter <phil@philpotter.co.uk>
Cc: davem@davemloft.net, kuba@kernel.org, willemb@google.com,
linmiaohe@huawei.com, linyunsheng@huawei.com, alobakin@pm.me,
elver@google.com, gnault@redhat.com, dseok.yi@samsung.com,
viro@zeniv.linux.org.uk, vladimir.oltean@nxp.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function
Date: Sat, 10 Apr 2021 12:12:38 +0200 [thread overview]
Message-ID: <CANn89iJdoaC9P_Nd=BrXVRyMS43YOg-DX=VciDO89mH_JPVRTg@mail.gmail.com> (raw)
In-Reply-To: <20210410095149.3708143-1-phil@philpotter.co.uk>
On Sat, Apr 10, 2021 at 11:51 AM Phillip Potter <phil@philpotter.co.uk> wrote:
>
> Zero-fill skb->data in __alloc_skb function of net/core/skbuff.c,
> up to start of struct skb_shared_info bytes. Fixes a KMSAN-found
> uninit-value bug reported by syzbot at:
> https://syzkaller.appspot.com/bug?id=abe95dc3e3e9667fc23b8d81f29ecad95c6f106f
>
> Reported-by: syzbot+2e406a9ac75bb71d4b7a@syzkaller.appspotmail.com
> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> ---
> net/core/skbuff.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 785daff48030..9ac26cdb5417 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -215,6 +215,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
> * to allow max possible filling before reallocation.
> */
> size = SKB_WITH_OVERHEAD(ksize(data));
> + memset(data, 0, size);
> prefetchw(data + size);
Certainly not.
There is a difference between kmalloc() and kzalloc()
Here you are basically silencing KMSAN and make it useless.
Please fix the real issue, or stop using KMSAN if it bothers you.
next prev parent reply other threads:[~2021-04-10 10:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-10 9:51 [PATCH] net: core: sk_buff: zero-fill skb->data in __alloc_skb function Phillip Potter
2021-04-10 10:12 ` Eric Dumazet [this message]
2021-04-10 11:00 ` Eric Dumazet
2021-04-10 23:33 ` Phillip Potter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANn89iJdoaC9P_Nd=BrXVRyMS43YOg-DX=VciDO89mH_JPVRTg@mail.gmail.com' \
--to=edumazet@google.com \
--cc=alobakin@pm.me \
--cc=davem@davemloft.net \
--cc=dseok.yi@samsung.com \
--cc=elver@google.com \
--cc=gnault@redhat.com \
--cc=kuba@kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=phil@philpotter.co.uk \
--cc=viro@zeniv.linux.org.uk \
--cc=vladimir.oltean@nxp.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).