HomeFreeBSD

linux: Fix sockopt copyout

Description

linux: Fix sockopt copyout

The Linux getsockopt did not check the size of the provided buffer when
copying out the value, leading to buffer overflows (e.g., for TCP_INFO).

Fix is to use the smaller of the option value size and the provided
buffer.

MFC after: 1 month
Relnotes: yes
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D55881

Details

Provenance
chuckAuthored on Jun 8 2026, 9:19 PM
Reviewer
kib
Differential Revision
D55881: linux: Fix sockopt copyout
Parents
rGea3426bc80aa: nuageinit: Create parent directories in write_files
Branches
Unknown
Tags
Unknown