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)
Tue, Mar 26, 12:24 AM
Unknown Object (File)
Mar 4 2024, 11:42 AM
Unknown Object (File)
Feb 11 2024, 4:54 PM
Unknown Object (File)
Feb 7 2024, 5:20 PM
Unknown Object (File)
Feb 2 2024, 5:14 AM
Unknown Object (File)
Feb 2 2024, 4:04 AM
Unknown Object (File)
Jan 14 2024, 5:00 AM
Unknown Object (File)
Jan 12 2024, 7:18 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