All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Serhat Kumral <serhatkumral1@gmail.com>,
	"yanjun.zhu@linux.dev" <yanjun.zhu@linux.dev>
Cc: mounter625@163.com, zyjzyj2000@gmail.com, xiongwm2026@163.com,
	jgg@ziepe.ca, leon@kernel.org, dsahern@kernel.org,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzbot+8c9eede336e3a843750e@syzkaller.appspotmail.com
Subject: Re: [RFC PATCH 1/2] RDMA/rxe: drive UDP tunnel socket lifetime from the GID table
Date: Tue, 28 Jul 2026 20:21:19 -0700	[thread overview]
Message-ID: <0bcef700-e148-46f3-93b9-c5fda5323aa1@linux.dev> (raw)
In-Reply-To: <20260728172825.43978-1-serhatkumral1@gmail.com>

在 2026/7/28 10:28, Serhat Kumral 写道:
> The crash reproduces here now, and it does not come from this series.
> 
> The tree in that git diff carries v2 of "RDMA/rxe: Hold netdev reference
> for transmit skbs", not the v3 I was pointed at. The pre-image blob of
> rxe_net.c in the diff is 44a16cb1601a, and on f2ec6312bf71:
> 
>    v2 applied -> rxe_net.c 44a16cb1601a
>    v3 applied -> rxe_net.c 86c9b19f65e1
> 
> v2 alone, without this series, crashes on the first run of
> rxe_rping_between_netns.sh:
> 
>    [   67.227061] Oops: general protection fault, probably for
>      non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
>    [   67.231014] KASAN: null-ptr-deref in range
>      [0x0000000000000000-0x0000000000000007]
>    [   67.240200] Workqueue: rxe_wq do_work [rdma_rxe]
>    [   67.241906] RIP: 0010:ip_rcv+0xeb/0x570
> 
> Same fault, same RIP, same Code bytes and same call trace as the oops
> reported in this thread, down to process_backlog+0x341/0x1110 and
> net_rx_action+0x87e/0xe00.
> 
> Runs of rxe_rping_between_netns.sh on f2ec6312bf71:
> 
>    f2ec6312bf71                 120/120
>    + this series                120/120
>    + v3                         120/120
>    + v3 + this series           220/220
>    + v2                         crash on run 1
>    + v2 + this series           crash on run 1
> 
> The mechanism is the one the v3 changelog describes. v2 releases the
> netdev through the live skb->dev and then clears it,
> 
>    if (skb->dev) {
>      dev_put(skb->dev);
>      skb->dev = NULL;
>    }
> 
> but skb->dev has already been rewritten by the transmit path, so the put
> lands on the wrong device and the receive side can find skb->dev == NULL.
> v3 keeps the held netdev in skb_shinfo(skb)->destructor_arg and never
> touches skb->dev.

Hi Serhat,

Thanks for the detailed analysis and testing.

I removed this patch from my tree, and the crash no longer reproduces. 
This confirms that the regression comes from the v2 version of 
"RDMA/rxe: Hold netdev reference for transmit skbs", not from this series.

The root cause analysis looks correct. Since skb->dev can be modified 
during the transmit path, using it to store the held netdev reference 
can result in releasing the wrong device reference. The v3 approach of 
storing the reference in skb_shinfo(skb)->destructor_arg avoids this issue.

I will take a closer look at the related code paths and continue the review.

Thanks again for the help.

Best regards,
Yanjun

> 
> So v3 is the one to carry. Nothing here points at the socket lifetime
> change.
> 
> thanks,
> serhat


      reply	other threads:[~2026-07-29  3:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18 14:26 [RFC PATCH 1/2] RDMA/rxe: drive UDP tunnel socket lifetime from the GID table Serhat Kumral
2026-07-18 14:26 ` [RFC PATCH 2/2] RDMA/nldev: remove the unused dellink link op Serhat Kumral
2026-07-18 15:39 ` [RFC PATCH 1/2] RDMA/rxe: drive UDP tunnel socket lifetime from the GID table Jason Gunthorpe
2026-07-19 17:54   ` Serhat Kumral
2026-07-18 16:01 ` Zhu Yanjun
2026-07-18 16:04   ` Jason Gunthorpe
2026-07-19  5:08 ` Zhu Yanjun
2026-07-19 17:59   ` Serhat Kumral
2026-07-19 20:50     ` Zhu Yanjun
2026-07-19 21:13       ` Zhu Yanjun
2026-07-20 18:15         ` Serhat Kumral
2026-07-20 19:19           ` yanjun.zhu
2026-07-26 14:02             ` Serhat Kumral
2026-07-27 19:55               ` Serhat Kumral
2026-07-28  3:42                 ` Zhu Yanjun
     [not found]                   ` <20260727220531.36724-1-serhatkumral1@gmail.com>
2026-07-28 16:14                     ` Zhu Yanjun
2026-07-28 17:28                       ` Serhat Kumral
2026-07-29  3:21                         ` Zhu Yanjun [this message]

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=0bcef700-e148-46f3-93b9-c5fda5323aa1@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=dsahern@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mounter625@163.com \
    --cc=serhatkumral1@gmail.com \
    --cc=syzbot+8c9eede336e3a843750e@syzkaller.appspotmail.com \
    --cc=xiongwm2026@163.com \
    --cc=zyjzyj2000@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.