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)
Sat, Apr 20, 1:50 AM
Unknown Object (File)
Thu, Apr 18, 9:15 AM
Unknown Object (File)
Tue, Apr 16, 6:15 AM
Unknown Object (File)
Jan 13 2024, 6:19 AM
Unknown Object (File)
Dec 23 2023, 4:11 AM
Unknown Object (File)
Dec 15 2023, 11:36 AM
Unknown Object (File)
Sep 8 2023, 12:47 PM
Unknown Object (File)
Aug 16 2023, 9:23 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

How is this queue locked?

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

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–1914

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