Page MenuHomeFreeBSD

setusercontext(): Apply user login context only on process' euid being set
ClosedPublic

Authored by olce on May 31 2023, 3:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 17 2024, 10:02 AM
Unknown Object (File)
Mar 17 2024, 10:02 AM
Unknown Object (File)
Mar 17 2024, 10:02 AM
Unknown Object (File)
Mar 17 2024, 10:02 AM
Unknown Object (File)
Mar 17 2024, 10:02 AM
Unknown Object (File)
Mar 17 2024, 10:02 AM
Unknown Object (File)
Mar 14 2024, 5:16 PM
Unknown Object (File)
Feb 10 2024, 3:54 PM

Details

Summary

Commit 35305a8dc114 (r211393) added a check on whether 'uid' was equal to
getuid() before calling setlogincontext(). Doing so still allows a setuid
program to apply resource limits and priorities specified in a user-controlled
configuration file ('~/.login_conf') where a non-setuid program could not. Plug
the hole by checking instead that the process' effective UID is the target one
(which is likely what was meant in the initial commit).

PR: 271750

Diff Detail

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

Event Timeline

olce requested review of this revision.May 31 2023, 3:18 PM
olce retitled this revision from setusercontext(): Apply login context on process' euid being set to setusercontext(): Apply user login context only on process' euid being set.

Clearer commit message's headling

olce edited the summary of this revision. (Show Details)

Add PR in commit message.

This revision is now accepted and ready to land.Jun 15 2023, 6:44 AM
This revision now requires review to proceed.Jun 21 2023, 1:57 PM

@kib Diff is the same as the one you validated. I updated the differential just to update the diff's base.

Re-validating, since the diff is the same as validated by @kib.

This revision is now accepted and ready to land.Jul 16 2023, 4:10 PM