Georgi Steffenhagen 34b9f9117f Fix use-after-free in send_ra_alias() for large router advertisements.
send_ra_alias() has the same problem relay_upstream6() had. It keeps
a pointer to the header of the router advertisement while prefixes and
options are added to the packet, and afterwards sets the router
lifetime and the M and O flags through it. If the advertisement
doesn't fit the packet buffer as it is, expand_buf() has moved the
buffer by then. The flags are set in memory which has been freed, and
the advertisement goes out without them, so hosts which see it don't
use DHCPv6.

The buffer starts out at 548 bytes, so this takes an advertisement
larger than that: many prefixes on one interface, or long lists of DNS
servers or search domains. It happens each time an advertisement needs
a larger buffer than any packet before it.

Find the header again each time before writing to it.

Credit to Georgi Steffenhagen (ServerTec IT Engineering) for
finding and fixing this.
2026-11-29 11:51:35 +00:00
2012-04-02 20:40:34 +01:00
2025-12-07 13:44:40 +00:00
2012-01-05 17:31:15 +00:00
2018-01-14 17:32:52 +00:00
2022-05-13 21:22:11 +01:00
2012-01-05 17:31:13 +00:00
2025-07-20 15:29:43 +01:00
2021-06-15 23:14:59 +01:00
2026-04-08 12:08:18 +01:00
2025-07-20 15:29:43 +01:00
2012-01-05 22:00:08 +00:00
S
Description
No description provided
GPL-2.0
6.5 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 94.3%
Perl 2.2%
HTML 1.2%
Shell 1%
Makefile 0.6%
Other 0.6%