WSL2-Linux-Kernel/drivers/staging
Aleksandr Mishin d8b09a5edc staging: iio: frequency: ad9834: Validate frequency parameter value
commit b48aa991758999d4e8f9296c5bbe388f293ef465 upstream.

In ad9834_write_frequency() clk_get_rate() can return 0. In such case
ad9834_calc_freqreg() call will lead to division by zero. Checking
'if (fout > (clk_freq / 2))' doesn't protect in case of 'fout' is 0.
ad9834_write_frequency() is called from ad9834_write(), where fout is
taken from text buffer, which can contain any value.

Modify parameters checking.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 12b9d5bf76 ("Staging: IIO: DDS: AD9833 / AD9834 driver")
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20240703154506.25584-1-amishin@t-argos.ru
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-09-12 11:07:50 +02:00
..
android
axis-fifo
board
clocking-wizard clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider() 2023-07-23 13:47:07 +02:00
emxx_udc staging: emxx_udc: Add checks for dma_alloc_coherent() 2023-03-11 13:57:34 +01:00
fbtft staging: fbtft: core: set smem_len before fb_deferred_io_init call 2024-02-23 08:55:15 +01:00
fieldbus
fwserial
gdm724x net: vlan: introduce skb_vlan_eth_hdr() 2023-12-20 15:17:35 +01:00
greybus greybus: arche-ctrl: move device table to its right location 2024-06-16 13:39:35 +02:00
gs_fpgaboot
iio staging: iio: frequency: ad9834: Validate frequency parameter value 2024-09-12 11:07:50 +02:00
ks7010 staging: ks7010: disable bh on tx_dev_lock 2024-09-04 13:23:22 +02:00
media media: atomisp: ssh_css: Fix a null-pointer dereference in load_video_binaries 2024-06-16 13:39:29 +02:00
most
mt7621-dma
mt7621-dts staging: mt7621-dts: change palmbus address to lower case 2023-03-03 11:45:53 +01:00
mt7621-pci PCI: mt7621: Add sentinel to quirks table 2022-12-31 13:14:26 +01:00
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
qlge
r8188eu
ralink-gdma
rtl8192e Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE" 2023-06-14 11:13:10 +02:00
rtl8192u staging: rtl8192u: Fix use after free in ieee80211_rx() 2022-12-31 13:14:30 +01:00
rtl8712 staging: rtl8712: fix race condition 2023-09-06 21:28:39 +01:00
rtl8723bs drivers: staging: rtl8723bs: Fix locking in rtw_scan_timeout_handler() 2023-05-11 23:00:31 +09:00
rts5208
sm750fb
unisys
vc04_services staging: vc04_services: fix information leak in create_component() 2024-04-10 16:19:32 +02:00
vme
vt6655
vt6656
wfx
wlan-ng
Kconfig
Makefile