android_kernel_motorola_sm6375/drivers/base
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Thiébaud Weksteen b38cf3cb17 firmware_loader: use kernel credentials when reading firmware
commit 581dd69830341d299b0c097fc366097ab497d679 upstream.

Device drivers may decide to not load firmware when probed to avoid
slowing down the boot process should the firmware filesystem not be
available yet. In this case, the firmware loading request may be done
when a device file associated with the driver is first accessed. The
credentials of the userspace process accessing the device file may be
used to validate access to the firmware files requested by the driver.
Ensure that the kernel assumes the responsibility of reading the
firmware.

This was observed on Android for a graphic driver loading their firmware
when the device file (e.g. /dev/mali0) was first opened by userspace
(i.e. surfaceflinger). The security context of surfaceflinger was used
to validate the access to the firmware file (e.g.
/vendor/firmware/mali.bin).

Previously, Android configurations were not setting up the
firmware_class.path command line argument and were relying on the
userspace fallback mechanism. In this case, the security context of the
userspace daemon (i.e. ueventd) was consistently used to read firmware
files. More Android devices are now found to set firmware_class.path
which gives the kernel the opportunity to read the firmware directly
(via kernel_read_file_from_path_initns). In this scenario, the current
process credentials were used, even if unrelated to the loading of the
firmware file.

Signed-off-by: Thiébaud Weksteen <[email protected]>
Cc: <[email protected]> # 5.10
Reviewed-by: Paul Moore <[email protected]>
Acked-by: Luis Chamberlain <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-05-25 09:14:38 +02:00
..
firmware_loader firmware_loader: use kernel credentials when reading firmware 2022-05-25 09:14:38 +02:00
power PM: core: keep irq flags in device_pm_check_callbacks() 2022-04-15 14:18:23 +02:00
regmap regmap: Fix possible double-free in regcache_rbtree_exit() 2021-11-02 19:46:13 +01:00
test
arch_topology.c arch_topology: Do not set llc_sibling if llc_id is invalid 2022-05-09 09:03:22 +02:00
attribute_container.c
base.h
bus.c
cacheinfo.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
class.c
component.c
container.c
core.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
cpu.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
dd.c driver core: dd: fix return value of __setup handler 2022-04-15 14:18:20 +02:00
devcon.c
devcoredump.c
devres.c
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:19:17 +01:00
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
module.c
node.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
pinctrl.c
platform-msi.c
platform.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
property.c
soc.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
swnode.c software node: Fix node registration 2021-03-17 17:03:48 +01:00
syscore.c
topology.c
transport_class.c