syzbot is hitting
WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface)
at batadv_iv_ogm_emit() [1], for forw_packet->if_outgoing->soft_iface can remain NULL if batadv_hardif_enable_interface() failed due to e.g. memory allocation fault injection.
Link: https://syzkaller.appspot.com/bug?id=9dc0c4cd70ad72df352243e887fd7e18901e7ce... [1] Reported-by: syzbot syzbot+c0b807de416427ff3dd1@syzkaller.appspotmail.com Tested-by: syzbot syzbot+c0b807de416427ff3dd1@syzkaller.appspotmail.com Signed-off-by: Tetsuo Handa penguin-kernel@I-love.SAKURA.ne.jp Fixes: ef0a937f7a1450d3 ("batman-adv: consider outgoing interface in OGM sending") --- net/batman-adv/bat_iv_ogm.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 789f257be24f..d24853c16ea5 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -409,6 +409,9 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet) if (WARN_ON(!forw_packet->if_outgoing)) return;
+ if (!forw_packet->if_outgoing->soft_iface) + return; + if (WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface)) return;