]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Validate psn_len in DIOCGETSRCNODES
authorKristof Provost <kp@FreeBSD.org>
Tue, 22 Jan 2019 02:13:33 +0000 (02:13 +0000)
committerKristof Provost <kp@FreeBSD.org>
Tue, 22 Jan 2019 02:13:33 +0000 (02:13 +0000)
commit180b0dcbbb8489a335b907f83aac450924f293a8
tree5a1c9916dffe63a0461b438622de46c3c1e65bde
parent264eeebe12bd3d537f4b7d5a7da3eafb7c95d9d2
pf: Validate psn_len in DIOCGETSRCNODES

psn_len is controlled by user space, but we allocated memory based on it.
Check how much memory we might need at most (i.e. how many source nodes we
have) and limit the allocation to that.

Reported by: markj
MFC after: 1 week
sys/netpfil/pf/pf_ioctl.c