mirror_ubuntu-kernels/drivers/gpu/drm/tiny
Nathan Chancellor 0c09bc33aa drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid()
When booting a kernel compiled with clang's CFI protection
(CONFIG_CFI_CLANG), there is a CFI failure in
drm_simple_kms_crtc_mode_valid() when trying to call
simpledrm_simple_display_pipe_mode_valid() through ->mode_valid():

[    0.322802] CFI failure (target: simpledrm_simple_display_pipe_mode_valid+0x0/0x8):
...
[    0.324928] Call trace:
[    0.324969]  __ubsan_handle_cfi_check_fail+0x58/0x60
[    0.325053]  __cfi_check_fail+0x3c/0x44
[    0.325120]  __cfi_slowpath_diag+0x178/0x200
[    0.325192]  drm_simple_kms_crtc_mode_valid+0x58/0x80
[    0.325279]  __drm_helper_update_and_validate+0x31c/0x464
...

The ->mode_valid() member in 'struct drm_simple_display_pipe_funcs'
expects a return type of 'enum drm_mode_status', not 'int'. Correct it
to fix the CFI failure.

Cc: stable@vger.kernel.org
Fixes: 11e8f5fd22 ("drm: Add simpledrm driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1647
Reported-by: Tomasz Paweł Gajc <tpgxyz@gmail.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220725233629.223223-1-nathan@kernel.org
2022-07-26 17:18:45 +02:00
..
arcpgu.c drm/arc: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:47 +01:00
bochs.c drm/bochs: Replace module-init boiler-plate code with DRM helpers 2022-01-19 18:40:00 +01:00
cirrus.c Cross-subsystem Changes: 2022-02-11 14:14:07 +10:00
gm12u320.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
hx8357d.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ili9163.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ili9225.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ili9341.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ili9486.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
Kconfig drm/tiny: Add MIPI DBI compatible SPI driver 2022-02-28 10:29:33 +01:00
Makefile drm/tiny: Add MIPI DBI compatible SPI driver 2022-02-28 10:29:33 +01:00
mi0283qt.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
panel-mipi-dbi.c drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
repaper.c Merge drm/drm-next into drm-misc-next 2022-04-05 11:06:58 +02:00
simpledrm.c drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid() 2022-07-26 17:18:45 +02:00
st7586.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
st7735r.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00