HomeFreeBSD

tcpdump: cope with incorrect packet lengths

Description

tcpdump: cope with incorrect packet lengths

It's possible for the capture buffer to be smaller than indicated by the
header length. However, pfsync_print() only took the header length into
account. As a result we could read outside of the buffer.

Check that we have at least the expected amount of data before we start
parsing.

PR: 278034
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44580

(cherry picked from commit 4848eb3af2a91b133c4b70cb9b71dd92ffec7f46)

Details

Provenance
kpAuthored on Apr 1 2024, 9:42 AM
Differential Revision
D44580: tcpdump: cope with incorrect packet lengths
Parents
rG5abbbb7c6401: sound: Remove leftover references to snd_clone
Branches
Unknown
Tags
Unknown