Page MenuHomeFreeBSD

Fix mbuf leaks in various pru_send implementations
ClosedPublic

Authored by markj on May 6 2021, 9:16 PM.
Tags
None
Referenced Files
F102136382: D30151.diff
Fri, Nov 8, 1:49 AM
Unknown Object (File)
Wed, Nov 6, 2:24 AM
Unknown Object (File)
Wed, Oct 30, 4:29 PM
Unknown Object (File)
Fri, Oct 18, 10:43 AM
Unknown Object (File)
Oct 3 2024, 10:44 AM
Unknown Object (File)
Oct 3 2024, 1:17 AM
Unknown Object (File)
Oct 2 2024, 10:26 PM
Unknown Object (File)
Oct 2 2024, 9:27 PM
Subscribers

Details

Summary

The various protocol implementations are not very consistent about
freeing mbufs in error paths. In general, all protocols must free both
"m" and "control" upon an error, except if PRUS_NOTREADY is specified
(this is only implemented by TCP and unix(4) and requires further work
not handled in this diff), in which case "control" still must be freed.

This diff plugs various leaks in the pru_send implementations.

N.B. in general we seem to avoid calling m_freem(NULL), though this
works fine in practice and would be consistent with other kernel memory
allocators. Is there some reason to keep this pattern?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningsys/netinet6/raw_ip6.c:893SPELL1Possible Spelling Mistake
Warningsys/netinet6/raw_ip6.c:895SPELL1Possible Spelling Mistake
Warningsys/netinet6/raw_ip6.c:897SPELL1Possible Spelling Mistake
Unit
No Test Coverage
Build Status
Buildable 39059
Build 35948: arc lint + arc unit