OSDN Git Service

misc: vmw_vmci: fix kernel info-leak by initializing dbells in vmci_ctx_get_chkpt_doo...
authorAnant Thazhemadam <anant.thazhemadam@gmail.com>
Sun, 22 Nov 2020 22:45:34 +0000 (04:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 18:36:26 +0000 (19:36 +0100)
A kernel-infoleak was reported by syzbot, which was caused because
dbells was left uninitialized.
Using kzalloc() instead of kmalloc() fixes this issue.

Reported-by: syzbot+a79e17c39564bedf0930@syzkaller.appspotmail.com
Tested-by: syzbot+a79e17c39564bedf0930@syzkaller.appspotmail.com
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Link: https://lore.kernel.org/r/20201122224534.333471-1-anant.thazhemadam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_vmci/vmci_context.c

index 1669536..26ff49f 100644 (file)
@@ -743,7 +743,7 @@ static int vmci_ctx_get_chkpt_doorbells(struct vmci_ctx *context,
                        return VMCI_ERROR_MORE_DATA;
                }
 
-               dbells = kmalloc(data_size, GFP_ATOMIC);
+               dbells = kzalloc(data_size, GFP_ATOMIC);
                if (!dbells)
                        return VMCI_ERROR_NO_MEM;