From: sashiko-bot@kernel.org
To: "Yehyeong Lee" <yhlee@isslab.korea.ac.kr>
Cc: "Alexander Gordeev" <agordeev@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH net v4 1/3] net/smc: fix use-after-free of the LLC qentry in smc_llc_srv_add_link()
Date: Sat, 01 Aug 2026 07:05:49 +0000 [thread overview]
Message-ID: <20260801070549.D621A1F00ACF@smtp.kernel.org> (raw)
In-Reply-To: <20260731070509.1818665-2-yhlee@isslab.korea.ac.kr>
> smc_llc_srv_add_link() keeps add_llc pointing into the queue entry:
>
> add_llc = &qentry->msg.add_link; smc_llc.c:1482
> ...
> smc_llc_save_add_link_info(link_new, add_llc); smc_llc.c:1494
> smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); smc_llc.c:1495
> ...
> u8 *llc_msg = smc_link_shared_v2_rxbuf(link) ?
> (u8 *)lgr->wr_rx_buf_v2 : (u8 *)add_llc; smc_llc.c:1504
> smc_llc_save_add_link_rkeys(link, link_new, llc_msg); smc_llc.c:1506
>
> smc_llc_flow_qentry_del() kfree()s the entry, so on a link without a shared
> v2 receive buffer the pointer handed to smc_llc_save_add_link_rkeys() is
> already freed. Before the Fixes: commit that branch always used
> lgr->wr_rx_buf_v2 and add_llc was not used after the free.
>
> Detach the entry instead of freeing it there, and free it explicitly on
> both exit paths. The reject path has to detach as well, otherwise it would
> be freed twice.
>
> Fixes: 27ef6a9981fe ("net/smc: support SMC-R V2 for rdma devices with max_recv_sge equals to 1")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260731070509.1818665-1-yhlee@isslab.korea.ac.kr?part=1
next prev parent reply other threads:[~2026-08-01 7:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 7:05 [PATCH net v4 0/3] net/smc: fix out-of-bounds and use-after-free in SMC-Rv2 LLC processing Yehyeong Lee
2026-07-31 7:05 ` [PATCH net v4 1/3] net/smc: fix use-after-free of the LLC qentry in smc_llc_srv_add_link() Yehyeong Lee
2026-08-01 7:05 ` sashiko-bot [this message]
2026-07-31 7:05 ` [PATCH net v4 2/3] net/smc: bound the peer rkey counts in SMC-Rv2 LLC messages Yehyeong Lee
2026-08-01 7:05 ` sashiko-bot
2026-08-01 9:10 ` Yehyeong Lee
2026-07-31 7:05 ` [PATCH net v4 3/3] net/smc: carry oversized SMC-Rv2 LLC messages in the queue entry Yehyeong Lee
2026-08-01 7:05 ` sashiko-bot
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=20260801070549.D621A1F00ACF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yhlee@isslab.korea.ac.kr \
/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.