[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_CBECC6CDB07A5A6C182C156DAC9490EB160A@qq.com>
Date: Tue, 16 Jan 2024 22:13:16 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+7ec955e36bb239bd720f@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [net?] KASAN: slab-out-of-bounds Read in dsa_user_prechangeupper
please test slab-out-of-bounds Read in dsa_user_prechangeupper
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3e7aeb78ab01
diff --git a/net/dsa/user.h b/net/dsa/user.h
index 996069130bea..9a40918ee7fc 100644
--- a/net/dsa/user.h
+++ b/net/dsa/user.h
@@ -53,7 +53,11 @@ int dsa_user_manage_vlan_filtering(struct net_device *dev,
static inline struct dsa_port *dsa_user_to_port(const struct net_device *dev)
{
- struct dsa_user_priv *p = netdev_priv(dev);
+ const struct rtnl_link_ops *ops = dev->rtnl_link_ops;
+ struct dsa_user_priv *p = ops->priv_size >= sizeof(*p) ?
+ netdev_priv(dev) : NULL;
+ if (!p)
+ return NULL;
return p->dp;
}
Powered by blists - more mailing lists