Page MenuHomeFreeBSD

Fix fget_only_user() to return ENOTCAPABLE on a failed capsicum check
ClosedPublic

Authored by arichardson on Feb 15 2021, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 1:22 PM
Unknown Object (File)
Wed, Oct 16, 4:29 PM
Unknown Object (File)
Oct 3 2024, 8:30 AM
Unknown Object (File)
Oct 2 2024, 6:19 AM
Unknown Object (File)
Oct 1 2024, 9:21 PM
Unknown Object (File)
Oct 1 2024, 7:32 PM
Unknown Object (File)
Oct 1 2024, 7:15 PM
Unknown Object (File)
Oct 1 2024, 5:30 PM
Subscribers

Details

Summary

After eaad8d1303da500ed691bd774742a4555a05e729 four additional
capsicum-test tests started failing. It turns out this is because
fget_only_user() was returning EBADF on a failed capsicum check instead
of forwarding the return value of cap_check_inline() like
fget_unlocked_seq().

Test Plan

capsicum-test failures before this:

[  FAILED  ] 7 tests, listed below:
[  FAILED  ] Capability.OperationsForked
[  FAILED  ] Capability.NoBypassDAC
[  FAILED  ] Pdfork.OtherUserForked
[  FAILED  ] PipePdfork.WildcardWait
[  FAILED  ] OpenatTest.WithFlag
[  FAILED  ] ForkedOpenatTest_WithFlagInCapabilityMode._
[  FAILED  ] Select.LotsOFileDescriptorsForked

After:

[  FAILED  ] 3 tests, listed below:
[  FAILED  ] Capability.NoBypassDAC
[  FAILED  ] Pdfork.OtherUserForked
[  FAILED  ] PipePdfork.WildcardWait

Diff Detail

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