linux-stable/drivers
Nathan Chancellor 0ad811cc08 drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid()
With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG),
indirect call targets are validated against the expected function
pointer prototype to make sure the call target is valid to help mitigate
ROP attacks. If they are not identical, there is a failure at run time,
which manifests as either a kernel panic or thread getting killed. A
proposed warning in clang aims to catch these at compile time, which
reveals:

  drivers/gpu/drm/sti/sti_hda.c:637:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_connector *, struct drm_display_mode *)' with an expression of type 'int (struct drm_connector *, struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict]
          .mode_valid = sti_hda_connector_mode_valid,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/sti/sti_dvo.c:376:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_connector *, struct drm_display_mode *)' with an expression of type 'int (struct drm_connector *, struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict]
          .mode_valid = sti_dvo_connector_mode_valid,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/sti/sti_hdmi.c:1035:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_connector *, struct drm_display_mode *)' with an expression of type 'int (struct drm_connector *, struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict]
          .mode_valid = sti_hdmi_connector_mode_valid,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

->mode_valid() in 'struct drm_connector_helper_funcs' expects a return
type of 'enum drm_mode_status', not 'int'. Adjust the return type of
sti_{dvo,hda,hdmi}_connector_mode_valid() to match the prototype's to
resolve the warning and CFI failure.

Link: https://github.com/ClangBuiltLinux/linux/issues/1750
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221102155623.3042869-1-nathan@kernel.org
2022-11-18 09:17:13 -08:00
..
accessibility
acpi More ACPI updates for 6.1-rc1 2022-10-10 13:28:06 -07:00
amba
android Scheduler changes for v6.1: 2022-10-10 09:10:28 -07:00
ata ata changes for 6.1-rc1 2022-10-07 10:48:49 -07:00
atm
auxdisplay
base cred: Do not default to init_cred in prepare_kernel_cred() 2022-11-01 10:04:52 -07:00
bcma Interrupt subsystem updates: 2022-10-12 10:23:24 -07:00
block Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
bluetooth
bus Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
cdrom
char prandom: remove unused functions 2022-10-11 17:42:58 -06:00
clk This is the final part of the clk patches for this merge window. 2022-10-16 11:08:19 -07:00
clocksource A boring time, timekeeping, timers update: 2022-10-10 10:16:00 -07:00
comedi
connector
counter gpio updates for v6.1-rc1 2022-10-08 09:46:29 -07:00
cpufreq Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
cpuidle RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
crypto This update includes the following changes: 2022-10-10 13:04:25 -07:00
cxl
dax libnvdimm for 6.1 2022-10-14 18:41:41 -07:00
dca
devfreq
dio
dma treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
dma-buf dma-buf: Proactively round up to kmalloc bucket size 2022-11-01 10:04:52 -07:00
edac Merge patch series "Use composable cache instead of L2 cache" 2022-10-13 11:07:13 -07:00
eisa
extcon Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
firewire
firmware Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2022-10-11 10:44:20 -07:00
fpga Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
fsi
gnss
gpio Interrupt subsystem updates: 2022-10-12 10:23:24 -07:00
gpu drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid() 2022-11-18 09:17:13 -08:00
greybus
hid Input updates for 6.1 merge window: 2022-10-11 10:53:25 -07:00
hsi
hte
hv hyperv-next for 6.1 2022-10-10 13:59:01 -07:00
hwmon Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
hwspinlock
hwtracing Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
i2c - correct a variable type in the new pci1xxxx driver 2022-10-11 11:03:42 -07:00
i3c i3c: master: Remove the wrong place of reattach. 2022-10-12 23:45:29 +02:00
idle
iio Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
infiniband treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
input Input updates for 6.1 merge window: 2022-10-11 10:53:25 -07:00
interconnect
iommu IOMMU Updates for Linux v6.1: 2022-10-10 13:20:53 -07:00
ipack Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
irqchip Interrupt subsystem updates: 2022-10-12 10:23:24 -07:00
isdn mISDN: hfcpci: Fix use-after-free bug in hfcpci_softirq 2022-10-09 19:11:54 +01:00
leds This is very quiet release for LEDs, pca963 got blinking support and 2022-10-14 13:14:03 -07:00
macintosh powerpc updates for 6.1 2022-10-09 14:05:15 -07:00
mailbox mailbox: qcom-ipcc: flag IRQ NO_THREAD 2022-10-05 21:51:58 -05:00
mcb
md treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
media treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
memory
memstick
message
mfd - Core Frameworks 2022-10-07 11:24:20 -07:00
misc treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
mmc Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
most
mtd Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
mux
net Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
nfc
ntb
nubus
nvdimm libnvdimm for 6.1 2022-10-14 18:41:41 -07:00
nvme Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
nvmem
of Devicetree updates for v6.1: 2022-10-10 13:13:51 -07:00
opp
parisc parisc architecture fixes and updates for kernel v6.1-rc1: 2022-10-14 12:10:01 -07:00
parport
pci pci-v6.1-fixes-1 2022-10-15 16:36:38 -07:00
pcmcia
peci
perf arm64 fixes: 2022-10-14 12:38:03 -07:00
phy pci-v6.1-changes 2022-10-11 11:08:18 -07:00
pinctrl Interrupt subsystem updates: 2022-10-12 10:23:24 -07:00
platform LoongArch changes for v6.1 2022-10-12 10:35:20 -07:00
pnp Merge branches 'acpi-apei', 'acpi-wakeup', 'acpi-reboot' and 'acpi-thermal' 2022-10-10 18:11:11 +02:00
power power supply and reset changes for the v6.1 series 2022-10-07 11:48:30 -07:00
powercap Scheduler changes for v6.1: 2022-10-10 09:10:28 -07:00
pps
ps3
ptp ] ptp: ocp: remove symlink for second GNSS 2022-10-10 08:37:24 +01:00
pwm pwm: Changes for v6.1-rc1 2022-10-07 11:32:10 -07:00
rapidio
ras
regulator - Core Frameworks 2022-10-07 11:24:20 -07:00
remoteproc remoteproc: virtio: Fix warning on bindings by removing the of_match_table 2022-10-05 09:20:44 -06:00
reset Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
rpmsg
rtc RTC for 6.1 2022-10-14 18:36:42 -07:00
s390 s390 updates for the 6.1 merge window #2 2022-10-14 11:36:05 -07:00
sbus
scsi treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
sh
siox
slimbus
soc Merge patch series "Use composable cache instead of L2 cache" 2022-10-13 11:07:13 -07:00
soundwire soundwire updates for 6.1-rc1 2022-10-07 16:13:55 -07:00
spi spi: Updates for v6.1 2022-10-04 19:36:53 -07:00
spmi spmi: pmic-arb: increase SPMI transaction timeout delay 2022-09-30 14:33:23 +02:00
ssb
staging Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
target treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
tc
tee - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
thermal More thermal control updates for 6.1-rc1 2022-10-10 13:52:14 -07:00
thunderbolt treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
tty parisc architecture fixes and updates for kernel v6.1-rc1: 2022-10-14 12:10:01 -07:00
ufs SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
uio
usb - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
vdpa virtio: fixes, features 2022-10-10 14:02:53 -07:00
vfio VFIO updates for v6.1-rc1 2022-10-12 14:46:48 -07:00
vhost virtio: fixes, features 2022-10-10 14:02:53 -07:00
video Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
virt Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
virtio virtio_pci: use irq to detect interrupt support 2022-10-13 09:33:03 -04:00
vlynq
w1 Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
watchdog linux-watchdog 6.1-rc1 tag 2022-10-13 10:31:13 -07:00
xen xen: branch for v6.1-rc1 2022-10-12 14:39:38 -07:00
zorro
Kconfig
Makefile