summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2023-06-21 00:55:35 +0530
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-07-05 20:29:28 +0000
commit1376622a9b0571274eb5974cecf17670dbbcd828 (patch)
treefa76f8cac08c65ec660689edabf7b24b22060b5d
parent844c5e5c09e13b15f071533badeab175234b716d (diff)
downloadminigbm-1376622a9b0571274eb5974cecf17670dbbcd828.tar.gz
minigbm: drv: Fix MINIGBM_DEBUG usage on Android
MINIGBM_DEBUG usage in drv_get_os_option() is broken on Cuttlefish at the moment and we run into following selinux denial. W libc : Access denied finding property "MINIGBM_DEBUG". I auditd : type=1400 audit(0.0:39): avc: denied { read } \ for comm="android.hardwar" name="u:object_r:default_prop:s0" \ dev="tmpfs" ino=184 scontext=u:r:hal_graphics_allocator_default:s0 \ tcontext=u:object_r:default_prop:s0 tclass=file permissive=0 On Android builds, MINIGBM_DEBUG can translate to a vendor property if not used as an env variable. To fix that property usage on Android, we start with using the proper (lowercase) Android property nomenclature. This will sadly break the usage of MINIGBM_DEBUG env variable on Android builds and will force users to use vendor.minigbm.debug property instead. Change-Id: I05a6213d2460cf5f7d20d3d04a014965ca03bebe Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4630128 Reviewed-by: Dominik Behr <dbehr@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Jason Macnak <natsu@google.com> Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
-rw-r--r--drv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drv.c b/drv.c
index e48a3d9..a2eef82 100644
--- a/drv.c
+++ b/drv.c
@@ -18,6 +18,9 @@
#ifdef __ANDROID__
#include <cutils/log.h>
#include <libgen.h>
+#define MINIGBM_DEBUG "vendor.minigbm.debug"
+#else
+#define MINIGBM_DEBUG "MINIGBM_DEBUG"
#endif
#include "drv_helpers.h"
@@ -114,7 +117,7 @@ struct driver *drv_create(int fd)
return NULL;
const char *minigbm_debug;
- minigbm_debug = drv_get_os_option("MINIGBM_DEBUG");
+ minigbm_debug = drv_get_os_option(MINIGBM_DEBUG);
drv->compression = (minigbm_debug == NULL) || (strcmp(minigbm_debug, "nocompression") != 0);
drv->fd = fd;