From: Alexey Simakov <bigalex934@gmail.com>
To: John Daley <johndale@cisco.com>,
Hyong Youb Kim <hyonkim@cisco.com>,
Sujith Sankar <ssujith@cisco.com>,
David Marchand <david.marchand@redhat.com>,
Neil Horman <nhorman@tuxdriver.com>
Cc: dev@dpdk.org, stable@dpdk.org, Alexey Simakov <bigalex934@gmail.com>
Subject: [PATCH] net/enic: fix possible null dereference in notify set
Date: Tue, 7 Jul 2026 14:20:14 +0300 [thread overview]
Message-ID: <20260707112014.82821-1-bigalex934@gmail.com> (raw)
The memset of notify_addr in vnic_dev_notify_setcmd() was performed
unconditionally before the device reset check. When the device is in
reset, vnic_dev_notify_set() skips the notification buffer allocation,
leaving notify_addr as NULL. The subsequent call to
vnic_dev_notify_setcmd() would then dereference the NULL pointer via
memset.
Move the memset inside the existing !vnic_dev_in_reset() guard where
notify_addr is guaranteed to be valid.
Fixes: 9913fbb91df0 ("enic/base: common code")
Cc: stable@dpdk.org
Signed-off-by: Alexey Simakov <bigalex934@gmail.com>
---
drivers/net/enic/base/vnic_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/enic/base/vnic_dev.c b/drivers/net/enic/base/vnic_dev.c
index ba8ecc16f2..e6d34622af 100644
--- a/drivers/net/enic/base/vnic_dev.c
+++ b/drivers/net/enic/base/vnic_dev.c
@@ -964,8 +964,8 @@ int vnic_dev_notify_setcmd(struct vnic_dev *vdev,
int wait = 1000;
int r;
- memset(notify_addr, 0, sizeof(struct vnic_devcmd_notify));
if (!vnic_dev_in_reset(vdev)) {
+ memset(notify_addr, 0, sizeof(struct vnic_devcmd_notify));
vdev->notify = notify_addr;
vdev->notify_pa = notify_pa;
}
--
2.34.1
next reply other threads:[~2026-07-07 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 11:20 Alexey Simakov [this message]
2026-07-09 9:51 ` [PATCH] net/enic: fix possible null dereference in notify set Hyong Youb Kim (hyonkim)
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=20260707112014.82821-1-bigalex934@gmail.com \
--to=bigalex934@gmail.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=hyonkim@cisco.com \
--cc=johndale@cisco.com \
--cc=nhorman@tuxdriver.com \
--cc=ssujith@cisco.com \
--cc=stable@dpdk.org \
/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