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
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
Unknown Object (File)
Oct 2 2024, 5:26 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable