| b2927170 | 15-Jun-2022 |
Micah Morton <[email protected]> |
LSM: SafeSetID: selftest cleanup and prepare for GIDs
Add some notes on how to run the test, update the policy file paths to reflect recent upstream changes, prepare test for adding GID testing.
Si
LSM: SafeSetID: selftest cleanup and prepare for GIDs
Add some notes on how to run the test, update the policy file paths to reflect recent upstream changes, prepare test for adding GID testing.
Signed-off-by: Micah Morton <[email protected]>
show more ...
|
| 8ef1ec0c | 05-Dec-2019 |
Masami Hiramatsu <[email protected]> |
selftests: safesetid: Fix Makefile to set correct test program
Fix Makefile to set safesetid-test.sh to TEST_PROGS instead of non existing run_tests.sh.
Without this fix, I got following error. -
selftests: safesetid: Fix Makefile to set correct test program
Fix Makefile to set safesetid-test.sh to TEST_PROGS instead of non existing run_tests.sh.
Without this fix, I got following error. ---- TAP version 13 1..1 # selftests: safesetid: run_tests.sh # Warning: file run_tests.sh is missing! not ok 1 selftests: safesetid: run_tests.sh ----
Fixes: c67e8ec03f3f ("LSM: SafeSetID: add selftest") Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 295c4e21 | 05-Dec-2019 |
Masami Hiramatsu <[email protected]> |
selftests: safesetid: Check the return value of setuid/setgid
Check the return value of setuid() and setgid(). This fixes the following warnings and improves test result.
safesetid-test.c: In funct
selftests: safesetid: Check the return value of setuid/setgid
Check the return value of setuid() and setgid(). This fixes the following warnings and improves test result.
safesetid-test.c: In function ‘main’: safesetid-test.c:294:2: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result] setuid(NO_POLICY_USER); ^~~~~~~~~~~~~~~~~~~~~~ safesetid-test.c:295:2: warning: ignoring return value of ‘setgid’, declared with attribute warn_unused_result [-Wunused-result] setgid(NO_POLICY_USER); ^~~~~~~~~~~~~~~~~~~~~~ safesetid-test.c:309:2: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result] setuid(RESTRICTED_PARENT); ^~~~~~~~~~~~~~~~~~~~~~~~~ safesetid-test.c:310:2: warning: ignoring return value of ‘setgid’, declared with attribute warn_unused_result [-Wunused-result] setgid(RESTRICTED_PARENT); ^~~~~~~~~~~~~~~~~~~~~~~~~ safesetid-test.c: In function ‘test_setuid’: safesetid-test.c:216:3: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result] setuid(child_uid); ^~~~~~~~~~~~~~~~~
Fixes: c67e8ec03f3f ("LSM: SafeSetID: add selftest") Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 4f72123d | 11-Apr-2019 |
Jann Horn <[email protected]> |
LSM: SafeSetID: verify transitive constrainedness
Someone might write a ruleset like the following, expecting that it securely constrains UID 1 to UIDs 1, 2 and 3:
1:2 1:3
However, because
LSM: SafeSetID: verify transitive constrainedness
Someone might write a ruleset like the following, expecting that it securely constrains UID 1 to UIDs 1, 2 and 3:
1:2 1:3
However, because no constraints are applied to UIDs 2 and 3, an attacker with UID 1 can simply first switch to UID 2, then switch to any UID from there. The secure way to write this ruleset would be:
1:2 1:3 2:2 3:3
, which uses "transition to self" as a way to inhibit the default-allow policy without allowing anything specific.
This is somewhat unintuitive. To make sure that policy authors don't accidentally write insecure policies because of this, let the kernel verify that a new ruleset does not contain any entries that are constrained, but transitively unconstrained.
Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Micah Morton <[email protected]>
show more ...
|