linux-stable/drivers/staging
Maximilian Luz 611d617bdb ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection()
commit dc608edf7d upstream.

Calling v4l2_subdev_get_try_crop() and v4l2_subdev_get_try_compose()
with a subdev state of NULL leads to a NULL pointer dereference. This
can currently happen in imgu_subdev_set_selection() when the state
passed in is NULL, as this method first gets pointers to both the "try"
and "active" states and only then decides which to use.

The same issue has been addressed for imgu_subdev_get_selection() with
commit 30d03a0de650 ("ipu3-imgu: Fix NULL pointer dereference in active
selection access"). However the issue still persists in
imgu_subdev_set_selection().

Therefore, apply a similar fix as done in the aforementioned commit to
imgu_subdev_set_selection(). To keep things a bit cleaner, introduce
helper functions for "crop" and "compose" access and use them in both
imgu_subdev_set_selection() and imgu_subdev_get_selection().

Fixes: 0d346d2a6f ("media: v4l2-subdev: add subdev-wide state struct")
Cc: stable@vger.kernel.org # for v5.14 and later
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-07 11:15:55 +01:00
..
axis-fifo
board
clocking-wizard
emxx_udc
fbtft staging: fbtft: core: set smem_len before fb_deferred_io_init call 2022-07-28 10:42:42 +02:00
fieldbus
fwserial
gdm724x staging: gdm724x: drop unused CDC defines 2022-07-25 10:57:42 +02:00
greybus staging: greybus: audio_helper: remove unused and wrong debugfs usage 2022-10-21 12:37:55 +02:00
iio
ks7010
media ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection() 2023-01-07 11:15:55 +01:00
most
nvec
octeon staging: switch to netif_napi_add_weight() 2022-07-08 14:28:21 +02:00
olpc_dcon Merge 5.19-rc3 into staging-next 2022-06-20 08:59:23 +02:00
pi433 staging: pi433: remove duplicated comments 2022-07-27 08:42:14 +02:00
qlge Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
r8188eu drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_join_timeout_handler 2022-12-31 13:26:24 +01:00
rtl8192e staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor() 2022-12-31 13:26:27 +01:00
rtl8192u staging: rtl8192u: Fix use after free in ieee80211_rx() 2022-12-31 13:26:27 +01:00
rtl8712 staging: rtl8712: fix use after free bugs 2022-08-30 17:15:16 +02:00
rtl8723bs staging: rtl8723bs: fix a potential memory leak in rtw_init_cmd_priv() 2022-10-21 12:39:24 +02:00
rts5208
sm750fb staging: sm750fb: fix CamelCase function parameter 2022-06-20 10:01:21 +02:00
vc04_services staging: vchiq_arm: Add missing memory barrier comments 2022-06-27 13:50:19 +02:00
vme_user vme: Fix error not catched in fake_init() 2022-12-31 13:26:27 +01:00
vt6655 staging: vt6655: fix potential memory leak 2022-10-21 12:39:22 +02:00
vt6656 wifi: mac80211: return a beacon for a specific link 2022-06-20 12:57:08 +02:00
wlan-ng Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-07-14 15:27:35 -07:00
Kconfig staging: octeon-usb: move driver out of staging 2022-06-21 16:43:37 +02:00
Makefile staging: octeon-usb: move driver out of staging 2022-06-21 16:43:37 +02:00