]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Avoid WARN on net_device without parent in netns
authorSven Eckelmann <sven@narfation.org>
Sun, 30 Dec 2018 11:46:01 +0000 (12:46 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sun, 30 Dec 2018 12:34:12 +0000 (13:34 +0100)
commit58f24b02eea20d67c4a5dc97458f5bb98d6581db
treed8d2960cbbc94fa917e2caed80a78b45ff6f2fec
parentbe71b73e794d4c8a0622db5abd894795dd25ee4f
batman-adv: Avoid WARN on net_device without parent in netns

It is not allowed to use WARN* helpers on potential incorrect input from
the user or transient problems because systems configured as panic_on_warn
will reboot due to such a problem.

A NULL return value of __dev_get_by_index can be caused by various problems
which can either be related to the system configuration or problems
(incorrectly returned network namespaces) in other (virtual) net_device
drivers. batman-adv should not cause a (harmful) WARN in this situation and
instead only report it via a simple message.

Fixes: 9b7cca42e01c ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface")
Reported-by: syzbot+c764de0fcfadca9a8595@syzkaller.appspotmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/hard-interface.c