From 20ca16779a1824bdfd100ed72d1b97d57164c50f Mon Sep 17 00:00:00 2001 From: Richard Chang Date: Tue, 29 Oct 2024 08:25:10 +0000 Subject: [PATCH] powerhint: Add WriteOnly flag for PA_KILL to avoid SELinux error The node "/sys/kernel/vendor_mm/pa_kill/reclaim_kb" is write-only. So we need to add WriteOnly flag to prevent powerhal to read the node. SELinux errors: avc: denied { dac_read_search } for comm="android.hardwar" capability=2 scontext=u:r:hal_power_default:s0 tcontext=u:r:hal_power_default:s0 tclass=capability permissive=0 avc: denied { dac_override } for comm="android.hardwar" capability=1 scontext=u:r:hal_power_default:s0 tcontext=u:r:hal_power_default:s0 tclass=capability permissive=0 Bug: 350830411 Change-Id: Ic78a419b1500efce631e848d36816bc87d666920 Test: adb shell dumpsys android.hardware.power.IPower/default, check if any avc denied messages Flag: EXEMPT config json change --- perf/powerhint-caiman.json | 1 + perf/powerhint-komodo.json | 1 + perf/powerhint-ripcurrent24.json | 1 + perf/powerhint-ripcurrentpro.json | 1 + perf/powerhint-tokay.json | 1 + perf/powerhint-zuma.json | 1 + 6 files changed, 6 insertions(+) diff --git a/perf/powerhint-caiman.json b/perf/powerhint-caiman.json index 5f2e974e..30f94955 100644 --- a/perf/powerhint-caiman.json +++ b/perf/powerhint-caiman.json @@ -958,6 +958,7 @@ "102400", "0" ], + "WriteOnly": true, "ResetOnInit": false }, { diff --git a/perf/powerhint-komodo.json b/perf/powerhint-komodo.json index ed65ab01..86dae6e0 100644 --- a/perf/powerhint-komodo.json +++ b/perf/powerhint-komodo.json @@ -958,6 +958,7 @@ "102400", "0" ], + "WriteOnly": true, "ResetOnInit": false }, { diff --git a/perf/powerhint-ripcurrent24.json b/perf/powerhint-ripcurrent24.json index ccab4c15..d1a2e484 100644 --- a/perf/powerhint-ripcurrent24.json +++ b/perf/powerhint-ripcurrent24.json @@ -612,6 +612,7 @@ "102400", "0" ], + "WriteOnly": true, "ResetOnInit": false } ], diff --git a/perf/powerhint-ripcurrentpro.json b/perf/powerhint-ripcurrentpro.json index 92bdfd14..5b7f18ff 100644 --- a/perf/powerhint-ripcurrentpro.json +++ b/perf/powerhint-ripcurrentpro.json @@ -882,6 +882,7 @@ "102400", "0" ], + "WriteOnly": true, "ResetOnInit": false }, { diff --git a/perf/powerhint-tokay.json b/perf/powerhint-tokay.json index 7504d48a..47ceaae8 100644 --- a/perf/powerhint-tokay.json +++ b/perf/powerhint-tokay.json @@ -958,6 +958,7 @@ "102400", "0" ], + "WriteOnly": true, "ResetOnInit": false }, { diff --git a/perf/powerhint-zuma.json b/perf/powerhint-zuma.json index 81374c04..1a75c204 100644 --- a/perf/powerhint-zuma.json +++ b/perf/powerhint-zuma.json @@ -796,6 +796,7 @@ "102400", "0" ], + "WriteOnly": true, "ResetOnInit": false } ],