HomeFreeBSD

In rtrequest and rtinit check for sa_len != 0 for the given
rS158294Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

In rtrequest and rtinit check for sa_len != 0 for the given
destination. These checks are needed so we do not install
a route looking like this:
(0) 192.0.2.200 UH tun0 =>

When removing this route the kernel will start to walk
the address space which looks like a hang on 64bit platforms
because it'll take ages while on 32bit you should see a panic
when kernel debugging options are turned on.

The problem is in rtrequest1:
if (netmask) {

		rt_maskedcopy(dst, ndst, netmask);

} else

		bcopy(dst, ndst, dst->sa_len);

In both cases the len might be 0 if the application forgot to
set it. If so ndst will be all-zero leading to above
mentioned strange routes.

This is an application error but we must not fail/hang/panic
because of this.

Looks ok: gnn
No objections: net@ (silence)
MFC after: 8 weeks

Details

Provenance
bzAuthored on
Parents
rS158293: MFC:
Branches
Unknown
Tags
Unknown

Event Timeline