HomeFreeBSD

dummynet: Avoid an out-of-bounds read in do_config()

Description

dummynet: Avoid an out-of-bounds read in do_config()

do_config() processes a buffer of variable-length dummynet commands.
The loop which processes this buffer loads the fixed-length header
before checking whether there are any bytes left to read, so it performs
a 4-byte read past the end of the buffer before terminating.

Restructure the loop to avoid this.

Reported by: Jenkins (KASAN job)
Reviewed by: kp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33132

Details

Provenance
markjAuthored on Nov 29 2021, 6:50 PM
Reviewer
kp
Differential Revision
D33132: dummynet: Avoid an out-of-bounds read in do_config()
Parents
rG3dd3a395ba97: ext2: Check for e2fs_first_dblock in ext2_compute_sb_data()
Branches
Unknown
Tags
Unknown