public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] misc: pci_endpoint_test: doorbell fixes
@ 2026-04-04  1:20 carlos.bilbao
  2026-04-04  1:20 ` [PATCH 1/2] misc: pci_endpoint_test: validate BAR index in doorbell test carlos.bilbao
  2026-04-04  1:20 ` [PATCH 2/2] misc: pci_endpoint_test: remove dead BAR read before doorbell trigger carlos.bilbao
  0 siblings, 2 replies; 6+ messages in thread
From: carlos.bilbao @ 2026-04-04  1:20 UTC (permalink / raw)
  To: mani, kwilczynski, kishon
  Cc: arnd, gregkh, linux-pci, linux-kernel, bilbao, Carlos Bilbao

From: Carlos Bilbao <carlos.bilbao@kernel.org>

pci_endpoint_test_doorbell() reads the BAR number from the endpoint's test
register space and uses it directly as an index into test->bar[] without
bounds checking.  Since the value is a raw u32 written by the endpoint
firmware, any value is possible; values >= PCI_STD_NUM_BARS result in an
out-of-bounds array access.

Patch 1 adds the missing bounds check.

Patch 2 removes a dead read of the same register that precedes the writel
sequence; the DB_BAR register carries no read side effect and the assigned
value is unconditionally overwritten before use.

 Carlos Bilbao (2):
   misc: pci_endpoint_test: validate BAR index in doorbell test
   misc: pci_endpoint_test: remove dead BAR read before doorbell trigger

---
 drivers/misc/pci_endpoint_test.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-10 22:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-04  1:20 [PATCH 0/2] misc: pci_endpoint_test: doorbell fixes carlos.bilbao
2026-04-04  1:20 ` [PATCH 1/2] misc: pci_endpoint_test: validate BAR index in doorbell test carlos.bilbao
2026-04-06 16:39   ` Koichiro Den
2026-04-10 22:47     ` Carlos Bilbao
2026-04-04  1:20 ` [PATCH 2/2] misc: pci_endpoint_test: remove dead BAR read before doorbell trigger carlos.bilbao
2026-04-06 16:41   ` Koichiro Den

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox