Page MenuHomeFreeBSD

netinet6: set ip6 after m_pullup() in nd6_ra_input()
AcceptedPublic

Authored by vinicius_ferrao.net.br on Tue, Jul 14, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 21, 9:02 PM
Unknown Object (File)
Mon, Jul 20, 10:49 PM
Unknown Object (File)
Mon, Jul 20, 10:27 PM
Unknown Object (File)
Mon, Jul 20, 9:30 PM
Unknown Object (File)
Mon, Jul 20, 9:25 PM
Unknown Object (File)
Mon, Jul 20, 7:03 PM
Unknown Object (File)
Mon, Jul 20, 6:43 AM
Unknown Object (File)
Mon, Jul 20, 12:54 AM

Details

Reviewers
pouria
Group Reviewers
network
Summary

nd6_ra_input() reads the IPv6 header pointer ip6 before m_pullup(), then
uses that pointer afterwards to set nd_ra.

When m_pullup() relocates the chain it frees the original first mbuf and
returns a new one, leaving ip6 dangling; the subsequent access may be a
use-after-free read.

The fix writes ip6 from the returned mbuf after m_pullup() inside the
conditional if.

Test Plan

Kernel was rebuilt and basic connectivity test was made.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Tue, Jul 14, 6:33 PM

LGTM

LOL.

That was extremely fast, I went to the kitchen to get a glass of water and it's approved.

I spent like 5 days testing it... haha.

Thanks @pouria