* [PATCH] qedf: Fix use-after-free in qedf_xmit error path
@ 2026-11-24 15:01 Jesse Taube
2026-11-24 15:10 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Jesse Taube @ 2026-11-24 15:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: linux-scsi, linux-kernel, James E.J. Bottomley, Nimal Prabudoss I,
jmeneghi, Nilesh Javali, Manish Rangankar,
GR-ETH-Storage-Upstream, Jesse Taube
In one of the error paths in qedf_xmit, we were freeing the skb and then
accessing the Fibre Channel frame header destination ID field stored
in the skb. Save d_id from the skb before freeing it to avoid a
use-after-free.
Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
---
drivers/scsi/qedf/qedf_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index da429b3a4283..ff7d93fbc079 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -1113,11 +1113,12 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp)
}
if (vn_port && ntoh24(fh->fh_d_id) != FC_FID_FLOGI) {
struct fc_rport_priv *rdata = NULL;
+ u32 d_id = ntoh24(fh->fh_d_id);
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
- "Dropping FCoE frame to %06x.\n", ntoh24(fh->fh_d_id));
+ "Dropping FCoE frame to %06x.\n", d_id);
kfree_skb(skb);
- rdata = fc_rport_lookup(lport, ntoh24(fh->fh_d_id));
+ rdata = fc_rport_lookup(lport, d_id);
if (rdata) {
rdata->retries = lport->max_rport_retry_count;
kref_put(&rdata->kref, fc_rport_destroy);
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qedf: Fix use-after-free in qedf_xmit error path
2026-11-24 15:01 [PATCH] qedf: Fix use-after-free in qedf_xmit error path Jesse Taube
@ 2026-11-24 15:10 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-24 15:10 UTC (permalink / raw)
To: Jesse Taube; +Cc: linux-scsi
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] scsi: qedf: missing Fixes: trailer for qedf_xmit()
use-after-free fix
--
commit 836b89bd048da8c05c1796d7b58ad9a04dabef00
Author: Jesse Taube <jtaubepe@redhat.com>
> qedf: Fix use-after-free in qedf_xmit error path
>
> In one of the error paths in qedf_xmit, we were freeing the skb and then
> accessing the Fibre Channel frame header destination ID field stored
> in the skb. Save d_id from the skb before freeing it to avoid a
> use-after-free.
>
> Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
[Severity: Low]
This fixes a use-after-free that has been present since the driver was
introduced. Should this include:
Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124150103.166306-1-jtaubepe@redhat.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-24 15:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 15:01 [PATCH] qedf: Fix use-after-free in qedf_xmit error path Jesse Taube
2026-11-24 15:10 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox