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-02-28 23:29:04 -07:00
2019-03-18 16:17:36 -07:00
2019-04-03 07:53:50 +00:00
2019-04-01 18:48:52 -06:00
2018-06-30 22:04:26 +00:00
2019-01-22 16:07:31 -08:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2018-01-29 11:09:14 -08:00
2019-02-28 23:29:04 -07:00
2019-01-30 15:38:25 -08:00
2019-04-01 22:09:19 +00:00
2019-04-02 10:27:03 -07:00
2018-02-18 22:43:13 -08:00
2018-02-16 22:11:35 +00:00
2019-04-03 14:49:24 +01:00
2019-02-01 13:43:43 +00:00
2019-03-18 12:04:18 +00:00
2019-03-15 10:28:06 +00:00
2019-03-13 11:49:42 +00:00
2019-03-18 07:59:22 -07:00
2019-03-19 14:26:57 -07:00
2018-02-16 14:17:41 -05:00
2019-04-02 19:19:13 +00:00
2018-11-21 17:33:53 +00:00
2019-02-28 23:29:04 -07:00
2019-03-18 12:04:18 +00:00
2018-04-06 14:59:07 -07:00
2019-03-27 13:58:20 -07:00
2019-04-04 11:19:24 -06:00
2018-04-11 16:37:57 -07:00
2019-01-26 16:40:54 +00:00
2019-02-28 23:29:04 -07:00
2018-05-10 18:17:50 +01:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-29 15:50:06 -06:00
2019-03-18 12:04:18 +00:00
2017-12-13 13:59:04 -07:00
2019-01-22 10:40:46 -08:00
2018-02-26 20:55:26 -08:00
2018-03-29 15:04:14 -07:00
2019-03-18 12:04:18 +00:00
2019-03-06 17:17:30 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2018-07-17 15:35:49 -07:00
2019-03-18 12:04:18 +00:00
2018-10-09 13:44:02 -07:00
2019-03-18 12:04:18 +00:00
2019-01-26 16:40:54 +00:00
2019-01-26 16:40:54 +00:00
2019-01-14 14:37:12 -08:00
2019-01-14 14:37:12 -08:00
2019-03-26 11:20:48 -07:00
2019-03-26 11:20:48 -07:00
2019-03-05 09:15:31 +00:00
2019-03-27 17:39:07 +08:00
2018-04-16 12:44:32 -06:00
2019-03-22 20:52:13 +00:00
2019-03-18 12:04:18 +00:00
2018-04-18 13:23:24 -07:00
2019-03-18 12:04:18 +00:00
2019-02-12 19:28:26 -08:00
2019-03-27 14:24:49 -04:00
2019-02-11 14:24:03 -08:00
2018-01-18 14:41:41 -08:00
2018-11-07 13:38:57 -08:00
2018-12-04 13:31:42 -08:00
2018-11-20 11:56:30 -08:00
2019-03-18 16:58:03 +00:00
2018-07-27 20:32:53 +01:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-02-28 23:29:04 -07:00
2019-03-06 17:17:30 +00:00
2018-07-27 20:32:53 +01:00
2019-01-25 11:22:58 -08:00
2019-03-18 12:04:18 +00:00
2018-12-28 16:05:22 -08:00
2019-02-28 23:29:04 -07:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2017-11-09 19:40:03 +00:00
2019-02-28 23:29:04 -07:00
2019-02-28 23:29:04 -07:00
2019-03-18 12:04:18 +00:00
2019-02-28 23:29:04 -07:00
2019-03-29 13:28:45 -07:00
2018-12-11 13:01:11 +00:00
2019-02-04 14:05:41 -08:00
2019-03-18 12:04:18 +00:00
2019-03-25 21:16:13 +00:00
2018-12-03 12:57:09 -07:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-02-28 23:29:04 -07:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-02-28 23:29:04 -07:00
2019-04-05 09:50:58 -07:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-21 15:16:58 +08:00
2019-03-18 12:04:18 +00:00
2019-02-28 23:29:04 -07:00
2019-03-18 12:04:18 +00:00
2018-02-16 22:11:35 +00:00
2019-03-18 12:04:18 +00:00
2018-01-24 13:08:19 -08:00
2019-02-28 23:29:04 -07:00
2017-10-20 16:29:59 -07:00
2019-02-28 23:29:04 -07:00
2019-03-18 12:04:18 +00:00
2019-03-21 16:23:31 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2018-12-12 15:02:26 +01:00
2019-03-18 12:04:18 +00:00
2019-02-28 23:29:04 -07:00
2018-11-19 15:28:49 +00:00
2017-11-01 09:43:14 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-08 15:23:29 -08:00
2018-12-12 15:02:26 +01:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 18:21:38 -07:00
2018-03-07 11:04:34 +00:00
2019-03-22 14:38:01 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-18 12:04:18 +00:00
2019-03-23 09:55:19 +00:00