]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: pressure: zpa2326: fix information leak in triggered buffer
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Mon, 25 Nov 2024 21:16:11 +0000 (22:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2025 16:15:54 +0000 (17:15 +0100)
commit64a989aa7475b8e76e69b9ec86819ea293e53bab
tree554c1dac4dc79b2997a81b3965d7c425c527bb31
parent19fc1c83454ca9d5699e39633ec79ce26355251c
iio: pressure: zpa2326: fix information leak in triggered buffer

commit 6007d10c5262f6f71479627c1216899ea7f09073 upstream.

The 'sample' local struct is used to push data to user space from a
triggered buffer, but it has a hole between the temperature and the
timestamp (u32 pressure, u16 temperature, GAP, u64 timestamp).
This hole is never initialized.

Initialize the struct to zero before using it to avoid pushing
uninitialized information to userspace.

Cc: stable@vger.kernel.org
Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-3-0cb6e98d895c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/pressure/zpa2326.c