Android Things LTS v1.0.0 (4760714)
Skip dropping the bounding set without SECURE_NOROOT.

If we're asked to skip setting *and* locking the SECURE_NOROOT
securebit, also skip dropping the bounding set. If the caller wants to
regain all capabilities when executing a set-user-ID-root program,
allow them to do so. The default behavior (i.e. the behavior without
|securebits_skip_mask| set) will still put the jailed process tree in a
capabilities-only environment.

This will allow giving powerd on Chrome OS some capabilities without
breaking other things.

Bug: 78629772
Test: New unit tests.
Test: Ad-hoc with fork+exec program + setuid program + -B 0x3
Test: Setuid program is able to keep all caps.

Change-Id: I36f79a42666720a65d88ec48454b56695f25b64b
5 files changed