hulk inclusion category: Bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9ICW7 CVE: NA
-------------------------------------------------
while CONFIG_IPVLAN_L2E is n, syz warn:
ipvlan_queue_xmit called for mode = [2] WARNING: CPU: 0 PID: 3209 at drivers/net/ipvlan/ipvlan_core.c:868 ipvlan_queue_xmit+0x238/0x278 drivers/net/ipvlan/ipvlan_core.c:868 Call trace: ipvlan_queue_xmit+0x238/0x278 drivers/net/ipvlan/ipvlan_core.c:868 ipvlan_start_xmit+0x5c/0x1b8 drivers/net/ipvlan/ipvlan_main.c:304 __netdev_start_xmit include/linux/netdevice.h:4953 [inline] netdev_start_xmit include/linux/netdevice.h:4967 [inline] xmit_one.constprop.0+0x114/0x3c0 net/core/dev.c:3576 dev_hard_start_xmit+0xb0/0x180 net/core/dev.c:3592 __dev_queue_xmit+0x2120/0x3778 net/core/dev.c:4372 dev_queue_xmit include/linux/netdevice.h:3146 [inline]
Reject setting to L2E mode while CONFIG_IPVLAN_L2E is disabled.
Fixes: 513b49cadd13 ("ipvlan: Introduce local xmit queue for l2e mode") Signed-off-by: Yue Haibing yuehaibing@huawei.com --- drivers/net/ipvlan/ipvlan_main.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index c273b0ff1f9d..67d03a17dd3f 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -63,6 +63,11 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval, int err;
ASSERT_RTNL(); + +#if !IS_ENABLED(CONFIG_IPVLAN_L2E) + if (nval == IPVLAN_MODE_L2E) + return -ENOTSUPP; +#endif if (port->mode != nval) { list_for_each_entry(ipvlan, &port->ipvlans, pnode) { flags = ipvlan->dev->flags;