Page MenuHomeFreeBSD

Remove a seemingly unnecessary assertion from in6p_lookup_mcast_ifp().

Authored by markj on Jul 30 2020, 12:46 AM.



syzkaller generated programs which created an IPv6 socket, cleared the
the IPV6_V6ONLY socket option, bound the socket to an IPv4-mapped
address, and invoked JOIN_GROUP or LEAVE_GROUP v6 socket options. Since
V6ONLY was cleared by the bind() call, this triggers an assertion
failure when in6p_lookup_mcast_ifp() gets called.

From reading the code I suspect that the assertion is unnecessary since
the inp address is not actually used by the multicast code. In other
words, whether or not the socket is connected or bound to an IPv4-mapped
IPv6 address is irrelevant. Thus I propose removing the assertion.

While here remove an unnecessary check for inp == NULL, which clearly
cannot happen.

Reported by:

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.