From: Igor Russkikh <irusskikh@marvell.com>
To: Daniil Maximov <daniil31415it@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Taehee Yoo <ap420073@gmail.com>,
Alexey Khoroshilov <khoroshilov@ispras.ru>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<bpf@vger.kernel.org>, <lvc-project@linuxtesting.org>
Subject: Re: [EXT] [PATCH] net: atlantic: Fix NULL dereference of skb pointer in
Date: Mon, 4 Dec 2023 17:06:46 +0100 [thread overview]
Message-ID: <08ae0a18-669e-b479-94d4-450a7a12efe9@marvell.com> (raw)
In-Reply-To: <20231204085810.1681386-1-daniil31415it@gmail.com>
Hi Daniil,
> If is_ptp_ring == true in the loop of __aq_ring_xdp_clean function,
> then a timestamp is stored from a packet in a field of skb object,
> which is not allocated at the moment of the call (skb == NULL).
>
> Generalize aq_ptp_extract_ts and other affected functions so they don't
> work with struct sk_buff*, but with struct skb_shared_hwtstamps*.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE
Thanks for finding this and working on this.
Have you reproduced it in wild, or this just comes out of static analysis?
I'm asking because looking into the flow you described - it looks like XDP
mode should immediately fail with null pointer access on any rx traffic.
But that was never reported.
I will try to debug and validate the fix, but this may take some time.
So for now
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
Thanks
Igor
next prev parent reply other threads:[~2023-12-04 16:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 8:58 [PATCH] net: atlantic: Fix NULL dereference of skb pointer in Daniil Maximov
2023-12-04 16:06 ` Igor Russkikh [this message]
2023-12-06 10:15 ` [EXT] " Даниил Максимов
2023-12-06 10:50 ` patchwork-bot+netdevbpf
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=08ae0a18-669e-b479-94d4-450a7a12efe9@marvell.com \
--to=irusskikh@marvell.com \
--cc=ap420073@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=daniil31415it@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=khoroshilov@ispras.ru \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.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