mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
bus: moxtet: fix potential stack buffer overflow
commit 3bf3c9744694803bd2d6f0ee70a6369b980530fd upstream.
The input_read function declares the size of the hex array relative to
sizeof(buf), but buf is a pointer argument of the function. The hex
array is meant to contain hexadecimal representation of the bin array.
Link: https://lore.kernel.org/r/[email protected]
Fixes: 5bc7f990cd ("bus: Add support for Moxtet bus")
Signed-off-by: Marek Behún <[email protected]>
Reported-by: sohu0106 <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
279c15b917
commit
fa3c053b83
1 changed files with 1 additions and 1 deletions
|
|
@ -466,7 +466,7 @@ static ssize_t input_read(struct file *file, char __user *buf, size_t len,
|
|||
{
|
||||
struct moxtet *moxtet = file->private_data;
|
||||
u8 bin[TURRIS_MOX_MAX_MODULES];
|
||||
u8 hex[sizeof(buf) * 2 + 1];
|
||||
u8 hex[sizeof(bin) * 2 + 1];
|
||||
int ret, n;
|
||||
|
||||
ret = moxtet_spi_read(moxtet, bin);
|
||||
|
|
|
|||
Loading…
Reference in a new issue