Page MenuHomeFreeBSD

Fix LOCAL_PEERCRED in 32-bit compat mode
ClosedPublic

Authored by asomers on Apr 27 2026, 11:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 17, 6:06 AM
Unknown Object (File)
Wed, Jun 17, 3:13 AM
Unknown Object (File)
Tue, Jun 16, 6:40 PM
Unknown Object (File)
Thu, Jun 4, 9:22 AM
Unknown Object (File)
Thu, Jun 4, 2:23 AM
Unknown Object (File)
Sat, May 30, 8:18 AM
Unknown Object (File)
May 22 2026, 7:40 PM
Unknown Object (File)
May 19 2026, 5:16 AM

Details

Summary

Previously the cr_pid field would be incorrectly copied to userland, due
to a size mismatch between the structure as defined in 32-bit vs 64-bit
builds. Fix it by converting the structure before copying it to
userland.

PR: 294833
Sponsored by: ConnectWise
MFC after: 1 week

Test Plan

Used the test program in Bugzilla

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added inline comments.
sys/kern/uipc_usrreq.c
2760
  • Respond to emaste's style comment.

Not just style, we don't want to leak kernel stack in struct gaps

LGTM, feel free to give other reviewers some time.

This revision is now accepted and ready to land.Apr 28 2026, 6:10 PM

LGTM, feel free to give other reviewers some time.

Thanks Ed. I'll wait a little while before committing.

This revision was automatically updated to reflect the committed changes.