]> 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>
Thu, 25 Mar 2021 18:37:45 +0000 (14:37 -0400)
commit72280d7e5734946e2592cfd8be6895c2b3fdf46b
tree49dc83d013422d2d25fbb5d56d40f7a2ef84f9e5
parent1f84105d7abadc53a7671f83e44607788276406d
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.

Approved by: re (cperciva)
Reported by: Q C <cq674350529@gmail.com>
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1af332a7d8f86b6fcc1f0f575fe5b06021b54f4c)
(cherry picked from commit e4bdf7ac2a32ba1f2402e06360e476ec804210e7)
usr.sbin/rtsold/rtsol.c