]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Do not allow negative ps_len in DIOCGETSTATES
authorkp <kp@FreeBSD.org>
Fri, 17 Apr 2020 14:35:11 +0000 (14:35 +0000)
committerkp <kp@FreeBSD.org>
Fri, 17 Apr 2020 14:35:11 +0000 (14:35 +0000)
commit9319f3ce0296c3334dfe2ce73bf9989665314f43
tree4db5a3b23ccc1c0e39cb15ee28cc8dbc7c3752fc
parent70066b93393435ae727727b8ef7716b3c7131ee0
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
sys/netpfil/pf/pf_ioctl.c