HomeFreeBSD

pf: Do not allow negative ps_len in DIOCGETSTATES

Description

pf: Do not allow negative ps_len in DIOCGETSTATES

Userspace may pass a negative ps_len value to us, which causes an
assertion failure in malloc().
Treat negative values as zero, i.e. return the required size.

Reported-by: syzbot+53370d9d0358ee2a059a@syzkaller.appspotmail.com
Reviewed by: lutz at donnerhacke.de
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24447

Details

Provenance
kpAuthored on Apr 17 2020, 2:35 PM
Parents
rG4e49fbcd3721: jail(8): improve manual and usage information with more clear
Branches
Unknown
Tags
Unknown

Event Timeline