Skip to content

Commit

Permalink
Disable kernel message in logd.rc
Browse files Browse the repository at this point in the history
this prevents logd from accessing kernel messages
  • Loading branch information
Azkali committed Dec 9, 2024
1 parent 3d94897 commit dd6764d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions rootdir/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions rootdir/etc/init/logd.halium.rc
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dd6764d

Please sign in to comment.