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
F97915356: D28691.diff
Tue, Oct 1, 5:30 PM
Unknown Object (File)
Mon, Sep 23, 7:20 PM
Unknown Object (File)
Sat, Sep 21, 6:00 AM
Unknown Object (File)
Sat, Sep 21, 6:00 AM
Unknown Object (File)
Sat, Sep 21, 6:00 AM
Unknown Object (File)
Sat, Sep 21, 5:51 AM
Unknown Object (File)
Thu, Sep 5, 11:38 AM
Unknown Object (File)
Wed, Sep 4, 6:37 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