]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 1 Aug 2025 17:03:35 +0000 (20:03 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 13 Aug 2025 21:25:04 +0000 (16:25 -0500)
commit1ad82f9db13d85667366044acdfb02009d576c5a
tree5495a97f33b4ec706c29b1516b69c48600d39646
parent57a75fa9d56e310e883e4377205690e88c05781b
misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl()

Commit eefb83790a0d ("misc: pci_endpoint_test: Add doorbell test case")
added NO_BAR (-1) to the pci_barno enum which, in practical terms,
changes the enum from an unsigned int to a signed int.  If the user
passes a negative number in pci_endpoint_test_ioctl() then it results in
an array underflow in pci_endpoint_test_bar().

Fixes: eefb83790a0d ("misc: pci_endpoint_test: Add doorbell test case")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/aIzzZ4vc6ZrmM9rI@suswa
drivers/misc/pci_endpoint_test.c