]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Close some races in multicast socket option handling.
authormarkj <markj@FreeBSD.org>
Tue, 14 May 2019 21:30:55 +0000 (21:30 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 14 May 2019 21:30:55 +0000 (21:30 +0000)
commit46ad7dbca8a28eaa926e794515d1b0f2e0bf6e26
treeaeb7d54036c06a5ec8e53ec24e716f3e236c4e7a
parentcf65b850fd1dffb74d0d0d42b00bb2629486bc32
Close some races in multicast socket option handling.

r333175 converted the global multicast lock to a sleepable sx lock,
so the lock order with respect to the (non-sleepable) inp lock changed.
To handle this, r333175 and r333505 added code to drop the inp lock,
but this opened races that could leave multicast group description
structures in an inconsistent state.  This change fixes the problem by
simply acquiring the global lock sooner.  Along the way, this fixes
some LORs and bogus error handling introduced in r333175, and commits
some related cleanup.

Reported by: syzbot+ba7c4943547e0604faca@syzkaller.appspotmail.com
Reported by: syzbot+1b803796ab94d11a46f9@syzkaller.appspotmail.com
Reviewed by: ae
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20070
sys/netinet/in_mcast.c
sys/netinet6/in6_mcast.c