mirror-linux/drivers/staging
Maximilian Luz 5038ee6776 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:11:51 +01:00
..
axis-fifo
board
emxx_udc
fbtft
fieldbus
gdm724x
greybus Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
iio
ks7010
media ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection() 2023-01-07 11:11:51 +01:00
most
nvec
octeon staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow 2022-09-24 13:07:31 +02:00
olpc_dcon
pi433 staging: pi433: use DEFINE_SHOW_ATTRIBUTE to simplify pi433_debugfs_regs 2022-09-24 13:05:41 +02:00
qlge net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
r8188eu drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_join_timeout_handler 2022-12-31 13:32:38 +01:00
rtl8192e staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor() 2022-12-31 13:32:42 +01:00
rtl8192u staging: rtl8192u: Fix use after free in ieee80211_rx() 2022-12-31 13:32:42 +01:00
rtl8712 staging: rtl8712: Fix return type for implementation of ndo_start_xmit 2022-09-09 09:55:24 +02:00
rtl8723bs Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
rts5208
sm750fb Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
vc04_services
vme_user vme: Fix error not catched in fake_init() 2022-12-31 13:32:42 +01:00
vt6655 staging: vt6655: fix some erroneous memory clean-up loops 2022-09-24 13:05:24 +02:00
vt6656
wlan-ng Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
Kconfig Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
Makefile Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00