44 lines
1.6 KiB
Diff
44 lines
1.6 KiB
Diff
From fac785e80fa91a71c29c95817110154e4c60464d Mon Sep 17 00:00:00 2001
|
|
From: Pierre-Hugues Husson <phh@phh.me>
|
|
Date: Fri, 6 Sep 2019 15:07:25 +0200
|
|
Subject: [PATCH 4/6] Allow /devices/virtual/block/ genfscon conflict (seen on
|
|
Xiaomi Mi 9)
|
|
|
|
Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
|
|
---
|
|
libsepol/cil/src/cil_post.c | 18 +++++++++++++++++-
|
|
1 file changed, 17 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
|
index 0b09cecc..255c9e12 100644
|
|
--- a/libsepol/cil/src/cil_post.c
|
|
+++ b/libsepol/cil/src/cil_post.c
|
|
@@ -477,7 +477,23 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
|
|
{
|
|
struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a;
|
|
struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b;
|
|
- return context_compare(a_genfscon->context, b_genfscon->context);
|
|
+ int rc = context_compare(a_genfscon->context, b_genfscon->context);
|
|
+ if(rc) {
|
|
+ fprintf(stderr, "hello %s\n", a_genfscon->fs_str);
|
|
+ int bypass = 0;
|
|
+ /*
|
|
+ * This conflict has been seen on Xiaomi Mi 9:
|
|
+ * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))
|
|
+ * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0))))
|
|
+ */
|
|
+ if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
|
+ bypass = 1;
|
|
+ if(bypass == 1) {
|
|
+ fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
|
|
+ return 0;
|
|
+ }
|
|
+ }
|
|
+ return rc;
|
|
}
|
|
|
|
int cil_post_netifcon_context_compare(const void *a, const void *b)
|
|
--
|
|
2.17.1
|
|
|