]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtsold: Fix validation of RDNSS options
authorMark Johnston <markj@FreeBSD.org>
Sun, 21 Mar 2021 18:18:10 +0000 (14:18 -0400)
committerMark Johnston <markj@FreeBSD.org>
Sun, 21 Mar 2021 18:19:42 +0000 (14:19 -0400)
commit1af332a7d8f86b6fcc1f0f575fe5b06021b54f4c
treeafdfa935a23aa7d18905f7f01c6b0b22bbc2f424
parent2476178e6b09acc8d0fe6b1fb9c1b6f2981f766e
rtsold: Fix validation of RDNSS options

The header specifies the size of the option in multiples of eight bytes.
The option consists of an eight-byte header followed by one or more IPv6
addresses, so the option is invalid if the size is not equal to 1+2n for
some n>0.  Check this.

The bug can cause random stack data to be formatted as an IPv6 address
and passed to resolvconf(8), but a host able to trigger the bug may also
specify arbitrary addresses this way.

Reported by: Q C <cq674350529@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
usr.sbin/rtsold/rtsol.c