From dd6764d5e068393d116e819002820c6d89d61602 Mon Sep 17 00:00:00 2001 From: Azkali Manad Date: Mon, 9 Dec 2024 08:06:11 +0000 Subject: [PATCH] Disable kernel message in logd.rc this prevents logd from accessing kernel messages --- device.mk | 1 + rootdir/Android.mk | 8 ++++++++ rootdir/etc/init/logd.halium.rc | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 rootdir/etc/init/logd.halium.rc diff --git a/device.mk b/device.mk index 2b49ccb..38b6b17 100644 --- a/device.mk +++ b/device.mk @@ -28,6 +28,7 @@ PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true PRODUCT_PACKAGES += \ init.disabled.rc \ init.halium.rc \ + logd.halium.rc \ vndk-detect \ on-post-data.sh diff --git a/rootdir/Android.mk b/rootdir/Android.mk index f5373e6..8d16c4c 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -20,6 +20,14 @@ LOCAL_SRC_FILES := etc/init.disabled.rc LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init include $(BUILD_PREBUILT) +include $(CLEAR_VARS) +LOCAL_MODULE := logd.halium.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init/logd.halium.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init +include $(BUILD_PREBUILT) + include $(CLEAR_VARS) LOCAL_MODULE := vndk-detect LOCAL_MODULE_TAGS := optional diff --git a/rootdir/etc/init/logd.halium.rc b/rootdir/etc/init/logd.halium.rc new file mode 100644 index 0000000..538c66c --- /dev/null +++ b/rootdir/etc/init/logd.halium.rc @@ -0,0 +1,14 @@ +service logd /system/bin/logd + override + socket logd stream 0666 logd logd + socket logdr seqpacket 0666 logd logd + socket logdw dgram+passcred 0222 logd logd +# HALIUM: don't log kernel messages +# file /proc/kmsg r +# file /dev/kmsg w + user logd + group logd system package_info readproc + capabilities SYSLOG AUDIT_CONTROL + priority 10 + task_profiles ServiceCapacityLow + onrestart setprop logd.ready false