提交 655288ad 编写于 作者: S Sven Eckelmann 提交者: Zheng Zengkai

batman-adv: Avoid WARN_ON timing related checks

stable inclusion
from stable-5.10.46
commit 282baa8104af44e04c4af3e7f933b44267c7f86f
bugzilla: 168323
CVE: NA

--------------------------------

[ Upstream commit 9f460ae3 ]

The soft/batadv interface for a queued OGM can be changed during the time
the OGM was queued for transmission and when the OGM is actually
transmitted by the worker.

But WARN_ON must be used to denote kernel bugs and not to print simple
warnings. A warning can simply be printed using pr_warn.
Reported-by: NTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Reported-by: syzbot+c0b807de416427ff3dd1@syzkaller.appspotmail.com
Fixes: ef0a937f ("batman-adv: consider outgoing interface in OGM sending")
Signed-off-by: NSven Eckelmann <sven@narfation.org>
Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 6c9054dd
...@@ -410,8 +410,10 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) ...@@ -410,8 +410,10 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet)
if (WARN_ON(!forw_packet->if_outgoing)) if (WARN_ON(!forw_packet->if_outgoing))
return; return;
if (WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface)) if (forw_packet->if_outgoing->soft_iface != soft_iface) {
pr_warn("%s: soft interface switch for queued OGM\n", __func__);
return; return;
}
if (forw_packet->if_incoming->if_status != BATADV_IF_ACTIVE) if (forw_packet->if_incoming->if_status != BATADV_IF_ACTIVE)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册