]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
VMCI: Resource wildcard match fixed
authorJorgen Hansen <jhansen@vmware.com>
Fri, 21 Sep 2018 07:31:05 +0000 (00:31 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:56:50 +0000 (19:56 -0600)
commita35b675bf1526cbe65b7b256ff676c6296b56d92
tree9b5918ec3ed999f79ead417f4db3833e1fd031d7
parent527aec7faa3556decf8ef2231bd1423d9e3ee43e
VMCI: Resource wildcard match fixed

BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit 11924ba5e671d6caef1516923e2bd8c72929a3fe ]

When adding a VMCI resource, the check for an existing entry
would ignore that the new entry could be a wildcard. This could
result in multiple resource entries that would match a given
handle. One disastrous outcome of this is that the
refcounting used to ensure that delayed callbacks for VMCI
datagrams have run before the datagram is destroyed can be
wrong, since the refcount could be increased on the duplicate
entry. This in turn leads to a use after free bug. This issue
was discovered by Hangbin Liu using KASAN and syzkaller.

Fixes: bc63dedb7d46 ("VMCI: resource object implementation")
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Adit Ranadive <aditr@vmware.com>
Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/misc/vmw_vmci/vmci_driver.c
drivers/misc/vmw_vmci/vmci_resource.c