Page MenuHomeFreeBSD

inpcb: poison several inpcb pointer in in_pcbfree()
ClosedPublic

Authored by glebius on Dec 20 2023, 7:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 2, 3:42 PM
Unknown Object (File)
May 15 2024, 9:03 PM
Unknown Object (File)
May 9 2024, 6:35 PM
Unknown Object (File)
May 9 2024, 6:35 PM
Unknown Object (File)
May 9 2024, 4:04 AM
Unknown Object (File)
May 9 2024, 3:59 AM
Unknown Object (File)
Mar 31 2024, 12:38 PM
Unknown Object (File)
Feb 3 2024, 8:21 AM
Subscribers

Details

Summary

There are few subsystems that reference inpcb and allow it to outlive
in_pcbfree(). There are no known bugs with them to unreference the
socket and options pointers for a freed inpcb. Enforce this so that
such bugs don't appear in the future.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Setting socket to non-NULL was too much of a change.

sys/netinet/in_pcb.c
1761

I think this should probably be unconditional? i.e., not dependent on whether INP_IPV6PROTO is set.

I'd prefer to leave it conditional if you don't mind. The field is IPv6 specific. In the past I tried to unionize IPv4 and IPv6 stuff in the inpcb. The blunt attempt failed, most likely due to 4to6 mapped connections. Maybe in future I'll make a smarter attempt. If that succeeds, then we should trash v6 pointers only for a INP_IPV6PROTO pcb.

I'd prefer to leave it conditional if you don't mind. The field is IPv6 specific. In the past I tried to unionize IPv4 and IPv6 stuff in the inpcb. The blunt attempt failed, most likely due to 4to6 mapped connections. Maybe in future I'll make a smarter attempt. If that succeeds, then we should trash v6 pointers only for a INP_IPV6PROTO pcb.

I don't mind, but IMHO it is a strange argument: it is not much work to move the poisoning back later if needed.

This revision is now accepted and ready to land.Dec 27 2023, 3:18 PM