linux/drivers/staging/iio
Zicheng Qu 6bd301819f staging: iio: frequency: ad9832: fix division by zero in ad9832_calc_freqreg()
In the ad9832_write_frequency() function, clk_get_rate() might return 0.
This can lead to a division by zero when calling ad9832_calc_freqreg().
The check if (fout > (clk_get_rate(st->mclk) / 2)) does not protect
against the case when fout is 0. The ad9832_write_frequency() function
is called from ad9832_write(), and fout is derived from a text buffer,
which can contain any value.

Link: https://lore.kernel.org/all/2024100904-CVE-2024-47663-9bdc@gregkh/
Fixes: ea707584ba ("Staging: IIO: DDS: AD9832 / AD9835 driver")
Cc: stable@vger.kernel.org
Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20241022134354.574614-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-10-24 18:30:47 +01:00
..
accel staging: iio: accel: adis16240: Call '__adis_initial_startup()' 2022-11-23 20:37:51 +00:00
adc iio:adc:ad7280a: Move out of staging 2022-02-21 19:33:05 +00:00
addac staging: iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-13 19:19:23 +01:00
Documentation iio: resolver: ad2s1210: move out of staging 2023-10-12 09:20:50 +01:00
frequency staging: iio: frequency: ad9832: fix division by zero in ad9832_calc_freqreg() 2024-10-24 18:30:47 +01:00
impedance-analyzer staging: iio: impedance-analyzer: ad5933: make use of iio_get_masklength() 2024-08-03 10:13:43 +01:00
Kconfig iio: resolver: ad2s1210: move out of staging 2023-10-12 09:20:50 +01:00
Makefile iio: resolver: ad2s1210: move out of staging 2023-10-12 09:20:50 +01:00
TODO staging: iio: remove mention of defunct list 2021-03-25 19:13:49 +00:00