ip6_output(): Check the return value of in6_getlinkifnet().
If the destination address has an embedded scope ID, make sure that it corresponds to a valid ifnet before proceeding. Otherwise a sendto() with a bogus link-local address can trigger a NULL pointer dereference. Reported by: syzkaller Reviewed by: ae Fixes: r358572 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25887
This commit is contained in:
parent
848f8effdd
commit
19afc65a7e
@ -761,6 +761,10 @@ again:
|
||||
IN6_IS_ADDR_MC_NODELOCAL(&dst_sa.sin6_addr)) {
|
||||
if (scopeid > 0) {
|
||||
ifp = in6_getlinkifnet(scopeid);
|
||||
if (ifp == NULL) {
|
||||
error = EHOSTUNREACH;
|
||||
goto bad;
|
||||
}
|
||||
*dst = dst_sa; /* XXX */
|
||||
goto nonh6lookup;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user