]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
usb: xhci: Fix a potential null pointer dereference in xhci_debugfs_create_endpoint()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Wed, 22 May 2019 11:33:58 +0000 (14:33 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit04b87109e20cf7c99164d9d2566c2ba9cdbb720e
tree4390cc2f384dc1a225787fb44d2be761e8adf4cd
parentd9fd264fdb1f93e4abe8cb400d890fa6afe01f71
usb: xhci: Fix a potential null pointer dereference in xhci_debugfs_create_endpoint()

BugLink: https://bugs.launchpad.net/bugs/1838824
[ Upstream commit 5bce256f0b528624a34fe907db385133bb7be33e ]

In xhci_debugfs_create_slot(), kzalloc() can fail and
dev->debugfs_private will be NULL.
In xhci_debugfs_create_endpoint(), dev->debugfs_private is used without
any null-pointer check, and can cause a null pointer dereference.

To fix this bug, a null-pointer check is added in
xhci_debugfs_create_endpoint().

This bug is found by a runtime fuzzing tool named FIZZER written by us.

[subjet line change change, add potential -Mathais]
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/host/xhci-debugfs.c