linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Stanislav Fomichev <sdf@google.com>
Cc: Kurt Kanzenbach <kurt@linutronix.de>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Song Yoong Siang <yoong.siang.song@intel.com>,
	Serge Semin <fancer.lancer@gmail.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	<netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>, <bpf@vger.kernel.org>
Subject: Re: [PATCH net] net: stmmac: Complete meta data only when enabled
Date: Fri, 23 Feb 2024 17:45:50 +0100	[thread overview]
Message-ID: <ZdjLvrBhW+NIcp85@boxer> (raw)
In-Reply-To: <CAKH8qBsCrYuT+18CsydQ5TeauRzu0Hdz7mZQ2c0W7er0KrJnkg@mail.gmail.com>

On Thu, Feb 22, 2024 at 11:53:14AM -0800, Stanislav Fomichev wrote:
> On Thu, Feb 22, 2024 at 1:45 AM Kurt Kanzenbach <kurt@linutronix.de> wrote:
> >
> > Currently using XDP/ZC sockets on stmmac results in a kernel crash:
> >
> > |[  255.822584] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000

would be good to explain where it comes from, no?

xsk_tx_metadata_to_compl() works on meta == NULL, it does not set
compl->tx_timestamp and later on xsk_tx_metadata_complete() tries to
dereference that.

> > |[...]
> > |[  255.822764] Call trace:
> > |[  255.822766]  stmmac_tx_clean.constprop.0+0x848/0xc38
> >
> > The program counter indicates xsk_tx_metadata_complete(). However, this
> > function shouldn't be called unless metadata is actually enabled.
> >
> > Tested on imx93 without XDP, with XDP and with XDP/ZC.
> >
> > Fixes: 1347b419318d ("net: stmmac: Add Tx HWTS support to XDP ZC")
> > Suggested-by: Serge Semin <fancer.lancer@gmail.com>
> > Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> > Tested-by: Serge Semin <fancer.lancer@gmail.com>
> > Link: https://lore.kernel.org/netdev/87r0h7wg8u.fsf@kurt.kurt.home/
> 
> Acked-by: Stanislav Fomichev <sdf@google.com>
> 
> LGTM, thanks!
> 
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index e80d77bd9f1f..8b77c0952071 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > @@ -2672,7 +2672,8 @@ static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue,
> >                         }
> >                         if (skb) {
> >                                 stmmac_get_tx_hwtstamp(priv, p, skb);
> > -                       } else {
> > +                       } else if (tx_q->xsk_pool &&
> > +                                  xp_tx_metadata_enabled(tx_q->xsk_pool)) {
> >                                 struct stmmac_xsk_tx_complete tx_compl = {
> >                                         .priv = priv,
> >                                         .desc = p,
> >
> > ---
> > base-commit: 603ead96582d85903baec2d55f021b8dac5c25d2
> > change-id: 20240222-stmmac_xdp-585ebf1680b3
> >
> > Best regards,
> > --
> > Kurt Kanzenbach <kurt@linutronix.de>
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-02-23 17:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22  9:45 [PATCH net] net: stmmac: Complete meta data only when enabled Kurt Kanzenbach
2024-02-22 19:53 ` Stanislav Fomichev
2024-02-23 16:45   ` Maciej Fijalkowski [this message]
2024-02-25 10:55     ` Kurt Kanzenbach

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=ZdjLvrBhW+NIcp85@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=ast@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=hawk@kernel.org \
    --cc=joabreu@synopsys.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.com \
    --cc=yoong.siang.song@intel.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).