]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fd: Avoid truncating output buffers for KERN_PROC_{CWD,FILEDESC}
authorMark Johnston <markj@FreeBSD.org>
Thu, 16 Dec 2021 21:07:04 +0000 (16:07 -0500)
committerMark Johnston <markj@FreeBSD.org>
Fri, 17 Dec 2021 18:10:23 +0000 (13:10 -0500)
commit36bd49ac4db8c62a3b354094646cbd8547ad2c51
tree590879abdde8ea14320387d55a15786c66a4b668
parent327060bd7799e5d4376693fba770a17b79e5a38d
fd: Avoid truncating output buffers for KERN_PROC_{CWD,FILEDESC}

These sysctls failed to return an error if the caller had provided too
short an output buffer.  Change them to return ENOMEM instead, to ensure
that callers can detect truncation in the face of a concurrently
changing fd table.

PR: 228432
Discussed with: cem, jhb
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15607
sys/kern/kern_descrip.c