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
F159147588: D30151.id.diff
Wed, Jun 10, 3:34 PM
F159118742: D30151.id88752.diff
Wed, Jun 10, 8:06 AM
F159088972: D30151.id89083.diff
Tue, Jun 9, 11:59 PM
Unknown Object (File)
Tue, Jun 9, 7:34 AM
Unknown Object (File)
Fri, May 22, 11:18 PM
Unknown Object (File)
Sun, May 17, 7:48 PM
Unknown Object (File)
Sun, May 17, 7:48 PM
Unknown Object (File)
May 1 2026, 12:46 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