Nick Kralevich d88acc95ab Don't set sehash when calling restoreconRecursive
restorecon_recursive updates the SELinux label of the files in the
filesystem, and then attempts to write the xattr "security.sehash" as an
optimization for future restorecons. Writing security.* extended
attributes requires CAP_SYS_ADMIN, which system_server doesn't have (and
shouldn't have).

Suppress the computation and writing of the hash value. It's not
needed.

This bug has been around for a long time, but due to the fix for
bug 62302954, the error message is being generated more frequently
now.

TODO: It would be better if the default for restorecon was to suppress
the hash computation, since otherwise it encourages programs to be
overprivileged with CAP_SYS_ADMIN. I'll plan on doing that in a followup
commit.

Bugs where this error message has been called out:
Bug: 129766333
Bug: 129271240
Bug: 128700692
Bug: 129925723

Test: install an APK and ensure that no "SELinux:  setxattr failed"
    error messages are generated.

(cherry picked from commit cb1dddad27)

Change-Id: Ifc5be24d14029cb616d5564366fc10a0b93c9939
2019-04-05 09:50:58 -07:00
2019-04-04 18:11:01 +00:00
2019-04-04 18:03:35 +00:00
2019-04-03 17:54:25 -04:00
2019-02-11 14:29:27 -08:00
2019-04-01 17:27:12 -07:00
2019-04-05 03:17:05 +00:00
2019-02-14 12:55:10 -05:00
2019-01-22 21:11:25 +00:00
Description
No description provided
21 GiB
Languages
Java 73.7%
Kotlin 14%
PowerBuilder 5.8%
C++ 5.2%
AIDL 1%