lkml.org 
[lkml]   [2023]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access
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
\
 
 \ /
  Last update: 2023-03-26 23:43    [W:2.343 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site