Page MenuHomeFreeBSD

wg: Fix some mbuf leaks in the input path
ClosedPublic

Authored by markj on Mar 2 2021, 3:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 15 2025, 8:40 AM
Unknown Object (File)
Dec 11 2025, 9:37 PM
Unknown Object (File)
Dec 8 2025, 11:26 AM
Unknown Object (File)
Dec 7 2025, 8:01 AM
Unknown Object (File)
Dec 2 2025, 6:15 AM
Unknown Object (File)
Nov 30 2025, 1:00 AM
Unknown Object (File)
Nov 27 2025, 4:57 PM
Unknown Object (File)
Nov 25 2025, 8:53 PM
Subscribers

Details

Summary
  • When m_defrag() fails we have to free the mbuf ourselves.
  • If the handshake input queue is full, we are responsible for dropping the packet.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37501
Build 34390: arc lint + arc unit

Event Timeline

markj requested review of this revision.Mar 2 2021, 3:11 PM
sys/dev/if_wg/module/if_wg_session.c
1939

How is this queue locked?

afedorov added inline comments.
sys/dev/if_wg/module/if_wg_session.c
1908

Hmm, is m_defrag() really needed here? This is a very costly operation due to allocation. Because we only need to get "pkttype", maybe using m_pullup is enough?

sys/dev/if_wg/module/if_wg_session.c
1908

That's a good question. wg_handshake() assumes that the entire packet is contiguous, though, so a pullup to get the packet type is not sufficient.

This revision is now accepted and ready to land.Mar 8 2021, 6:45 AM