firewire: Fix out-of-bounds access in CSR iterator
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 1 replyIn review
- v11 patch 1 replySuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | firewire: Fix out-of-bounds access in CSR iteratordrivers/ | +5 | 0 replies | |
| 2/2 | firewire: Add KUnit tests for CSR iteratordrivers/ drivers/ drivers/ +1 more | +110 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/2] firewire: Fix out-of-bounds access in CSR iterator
Hi Takashi,
This series fixes an out-of-bounds read in fw_csr_iterator_next() and adds KUnit tests for the CSR iterator.
The first patch fixes the iterator by checking its position before dereferencing the current entry.
The second patch adds a separate KUnit test suite covering:
- Iteration over valid entries.
- Calling the iterator after reaching the end.
- Iteration over an empty directory.
It also adds a separate Kconfig option for the iterator tests.
Testing:
- Ran the FireWire KUnit tests using:
python3 tools/testing/kunit/kunit.py run
--kunitconfig=drivers/firewire/.kunitconfig
- All tests passed.
- Results:
[14:47:14] ======== firewire-config-rom-iterator (3 subtests) ========= [14:47:14] [PASSED] test_csr_iterator_with_valid_entries [14:47:14] [PASSED] test_csr_iterator_at_end
[14:47:14] [PASSED] test_csr_iterator_empty_directory [14:47:14] ========== [PASSED] firewire-config-rom-iterator ===========
Please review the patches.
Regards,
Sreeraj
Sreeraj S Kurup (2):
firewire: Fix out-of-bounds access in CSR iterator
firewire: Add KUnit tests for CSR iterator
drivers/firewire/.kunitconfig | 1 + drivers/firewire/Kconfig | 12 +++ drivers/firewire/config-rom-iterator-test.c | 93 +++++++++++++++++++++ drivers/firewire/core-device.c | 10 ++- 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 drivers/firewire/config-rom-iterator-test.c
Signature · 1 line
2.55.0