mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Bluetooth: RFCOMM - Fix info leak in ioctl(RFCOMMGETDEVLIST)
The RFCOMM code fails to initialize the two padding bytes of struct rfcomm_dev_list_req inserted for alignment before copying it to userland. Additionally there are two padding bytes in each instance of struct rfcomm_dev_info. The ioctl() that for disclosures two bytes plus dev_num times two bytes uninitialized kernel heap memory. Allocate the memory using kzalloc() to fix this issue. Signed-off-by: Mathias Krause <[email protected]> Cc: Marcel Holtmann <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Johan Hedberg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
9ad2de43f1
commit
f9432c5ec8
1 changed files with 1 additions and 1 deletions
|
|
@ -456,7 +456,7 @@ static int rfcomm_get_dev_list(void __user *arg)
|
|||
|
||||
size = sizeof(*dl) + dev_num * sizeof(*di);
|
||||
|
||||
dl = kmalloc(size, GFP_KERNEL);
|
||||
dl = kzalloc(size, GFP_KERNEL);
|
||||
if (!dl)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue