]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:09:09 +0000 (08:09 +0200)
commitfc0193f074635325859cab6ea59eb2cd1ef3da85
tree752b108b164c42ffadb200955e98ea9f9acd4a77
parentb53f68045b8b668660a8ccacbd2616589c1c4479
usb: xhci: Fix a potential null pointer dereference in xhci_debugfs_create_endpoint()

[ 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>
drivers/usb/host/xhci-debugfs.c