public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access
@ 2023-01-16 23:57 Piergiorgio Beruto
  2023-01-17  0:34 ` Vladimir Oltean
  0 siblings, 1 reply; 3+ messages in thread
From: Piergiorgio Beruto @ 2023-01-16 23:57 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, netdev, Oleksij Rempel, mailhol.vincent,
	sudheer.mogilappagari, sbhatta, linux-doc, wangjie125, corbet,
	lkp, gal, gustavoars, bagasdotme

Fix problem found by syzbot dereferencing a device pointer.

Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
Reported-by: syzbot+8cf35743af243e5f417e@syzkaller.appspotmail.com
Fixes: 8580e16c28f3 ("net/ethtool: add netlink interface for the PLCA RS")
---
 net/ethtool/plca.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c
index be7404dc9ef2..bc3d31f99998 100644
--- a/net/ethtool/plca.c
+++ b/net/ethtool/plca.c
@@ -155,6 +155,8 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
 		return ret;
 
 	dev = req_info.dev;
+	if(!dev)
+		return -ENODEV;
 
 	rtnl_lock();
 
-- 
2.37.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-17  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 23:57 [PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access Piergiorgio Beruto
2023-01-17  0:34 ` Vladimir Oltean
2023-01-17  9:13   ` Piergiorgio Beruto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox