]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
batman-adv: mcast: fix multicast tt/tvlv worker locking
authorLinus Lüssing <linus.luessing@c0d3.blue>
Wed, 24 Apr 2019 01:19:14 +0000 (03:19 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:11:36 +0000 (14:11 +0200)
commita1c52b6afd6b83fc5ec7b11ce44f74b56f3ee91f
tree6e042d17d398ff5b33201bf7b5787df21a277353
parent9576ed6db49b802c72bc288b42aeaaa6748d6d56
batman-adv: mcast: fix multicast tt/tvlv worker locking

BugLink: https://bugs.launchpad.net/bugs/1837517
commit a3c7cd0cdf1107f891aff847ad481e34df727055 upstream.

Syzbot has reported some issues with the locking assumptions made for
the multicast tt/tvlv worker: It was able to trigger the WARN_ON() in
batadv_mcast_mla_tt_retract() and batadv_mcast_mla_tt_add().
While hard/not reproduceable for us so far it seems that the
delayed_work_pending() we use might not be quite safe from reordering.

Therefore this patch adds an explicit, new spinlock to protect the
update of the mla_list and flags in bat_priv and then removes the
WARN_ON(delayed_work_pending()).

Reported-by: syzbot+83f2d54ec6b7e417e13f@syzkaller.appspotmail.com
Reported-by: syzbot+050927a651272b145a5d@syzkaller.appspotmail.com
Reported-by: syzbot+979ffc89b87309b1b94b@syzkaller.appspotmail.com
Reported-by: syzbot+f9f3f388440283da2965@syzkaller.appspotmail.com
Fixes: cbebd363b2e9 ("batman-adv: Use own timer for multicast TT and TVLV updates")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/batman-adv/main.c
net/batman-adv/multicast.c
net/batman-adv/types.h