Closed ildar closed 1 year ago
More info:
02-01 02:41:46.764 1193 1193 W composer-servic: type=1400 audit(0.0:1666): avc: denied { write } for name="brightness" dev="sysfs" ino=45865 scontext=u:r:hal_graphics_composer_default:s0 tcontext=u:object_r:sysfs_lcd_writable:s0 tclass=file permissive=0
02-01 02:41:46.767 1193 1193 E SDM : HWPeripheralDRM::SetPanelBrightness: Failed to open node = /sys/class/backlight/panel0-backlight/brightness, error = Permission denied
the ls -alZ
:
-rw-r--r-- 1 system system u:object_r:vendor_sysfs_graphics:s0 4096 2023-02-01 13:46 /sys/class/backlight/panel0-backlight/brightness
Does the errors in the log disappear after the kickstart?
Does the result of ls -alZ
change before/after the kickstart?
Can you remove /system/bin/rw-system.sh and see the result? also provide a ls -alZ
On Thu, Feb 2, 2023 at 3:51 AM Pierre-Hugues HUSSON wrote:
Does the errors in the log disappear after the kickstart?
The error does not appear when
/system/bin/rw-system.sh
removed.Does the result of ls -alZ change before/after the kickstart?
before it.
Can you remove /system/bin/rw-system.sh and see the result? also provide a ls -alZ
Wow! the brightness works after removing
/system/bin/rw-system.sh
! Thels -alZ
is same: -rw-r--r-- 1 system system u:object_r:vendor_sysfs_graphics:s0 4096 1972-05-18 22:33 /sys/class/backlight/panel0-backlight/brightness
also:
Does the errors in the log disappear after the kickstart?
Yes.
Does the result of ls -alZ change before/after the kickstart?
Yes. Before and After: -rw-r--r-- 1 system system u:object_r:sysfs_lcd_writable:s0 4096 1972-05-18 22:43 /sys/class/backlight/panel0-backlight/brightness :/data/data # echo 1 > /sys/class/backlight/panel0-backlight/brightness :/data/data # ls -alZ /sys/class/backlight/panel0-backlight/brightness -rw-r--r-- 1 system system u:object_r:vendor_sysfs_graphics:s0 4096 2023-02-03 00:38 /sys/class/backlight/panel0-backlight/brightness
These all with the /system/bin/rw-system.sh
in place.
Ok, so the issue is that rw-system.sh sets the context to sysfs_lcd_writable, while it shouldn't. Thing is, it will do that under exactly one condition, which is that the file is u:object_r:sysfs:s0. Which according to your logs, it isn't, so I don't quite understand.
So please do grep vendor_sysfs_graphics -r /vendor
and send me all the files that match this. Same for grep /sys/class/backlight -r /vendor
On my side I'll check the code again to check if there might be a bug there.
greetings! somehow I cannot reproduce the problem anymore. I tried to debug the issue with the rw-system.sh. After it "fixed itself" I reverted back all the changes but the bug disappeared. Tried with and without my overlay. Sorry. You can look at the full transcript here: https://defuse.ca/b/EudfZXlqESOV44t5plqMKX
Current Behavior:
Primary brightness control doesn't change it.
Smartphone (please complete the following information):
Additional context
The LOS is TD-based. The brightness is stuck at
131
level:The following command makes brightness work: