Fix kernel memory disclosures in mpr and mps
authorAlan Somers <asomers@FreeBSD.org>
Wed, 1 Mar 2023 18:53:46 +0000 (11:53 -0700)
committerAlan Somers <asomers@FreeBSD.org>
Thu, 2 Mar 2023 20:31:06 +0000 (13:31 -0700)
commit72aad3f9028af12e6c56a3a461b46a153abd7b24
tree5bb9765df3055db84feb1b81b960997747187d5c
parent0fed8288c3fd75a57e3fd4649cded9eac07a6758
Fix kernel memory disclosures in mpr and mps

In every mpr and mps ioctl that copies kernel data to userland, validate
that the requested length does not exceed the size of the kernel's
buffer.

Note that all of these ioctls already required root access.

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D38842
sys/dev/mpr/mpr_user.c
sys/dev/mps/mps_user.c