android_kernel_motorola_sm6375/drivers/firmware
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nathan Chancellor efed363752 qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute
commit fca41af18e10318e4de090db47d9fa7169e1bf2f upstream.

fw_cfg_showrev() is called by an indirect call in kobj_attr_show(),
which violates clang's CFI checking because fw_cfg_showrev()'s second
parameter is 'struct attribute', whereas the ->show() member of 'struct
kobj_structure' expects the second parameter to be of type 'struct
kobj_attribute'.

$ cat /sys/firmware/qemu_fw_cfg/rev
3

$ dmesg | grep "CFI failure"
[   26.016832] CFI failure (target: fw_cfg_showrev+0x0/0x8):

Fix this by converting fw_cfg_rev_attr to 'struct kobj_attribute' where
this would have been caught automatically by the incompatible pointer
types compiler warning. Update fw_cfg_showrev() accordingly.

Fixes: 75f3e8e47f ("firmware: introduce sysfs driver for QEMU's fw_cfg device")
Link: https://github.com/ClangBuiltLinux/linux/issues/1299
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Sami Tolvanen <[email protected]>
Tested-by: Sedat Dilek <[email protected]>
Reviewed-by: Sami Tolvanen <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-07-19 08:53:16 +02:00
..
arm_scmi firmware: arm_scmi: Add missing Rx size re-initialisation 2020-11-05 11:43:12 +01:00
broadcom
efi efi: cper: fix snprintf() use in cper_dimm_err_location() 2021-06-10 13:37:03 +02:00
google
imx firmware: imx: select SOC_BUS to fix firmware build 2021-02-03 23:25:59 +01:00
meson
psci
tegra
xilinx
arm_scpi.c firmware: arm_scpi: Prevent the ternary sign expansion bug 2021-05-26 12:05:14 +02:00
arm_sdei.c
dmi-id.c
dmi-sysfs.c
dmi_scan.c
edd.c
iscsi_ibft.c
iscsi_ibft_find.c
Kconfig firmware: qcom-scm: Fix QCOM_SCM configuration 2021-05-14 09:44:22 +02:00
Makefile
memmap.c
pcdp.c
pcdp.h
qcom_scm-32.c
qcom_scm-64.c
qcom_scm.c
qcom_scm.h
qemu_fw_cfg.c qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute 2021-07-19 08:53:16 +02:00
raspberrypi.c
scpi_pm_domain.c
stratix10-rsu.c
stratix10-svc.c firmware: stratix10-svc: Fix a resource leak in an error handling path 2021-07-14 16:53:40 +02:00
ti_sci.c
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c