iio: adc: xilinx-ams: fix out-of-bounds accesses when parsing channels
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 4 repliesIn review
- v2 posting 2/21 patch 3 repliesSuperseded
- v2 posting 1/21 patch 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 1 patch | 1 reply | Superseded |
Changes in v3 from the cover letter
- New patch 1: limit the binding to channels 30-50 (Sai)
- Patch 2: only accept channels 30-50, so a channel node can no longer duplicate a fixed channel (Sai), and add a static_assert() that ams_pl_channels[] holds the fixed plus the external channels
- Patch 2: rework the commit message around the duplicate channels
- Rebase on fixes-togreg (now on 7.4-rc1)
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | dt-bindings: iio: adc: xlnx,zynqmp-ams: limit external channels to 30-50Documentation/ | +4 | 2 replies | |
| 2/2 | iio: adc: xilinx-ams: fix out-of-bounds accesses when parsing channelsdrivers/ | +46 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Sai Krishna Potthuri | Krzysztof Kozlowski |
|---|---|---|
| 1/2 | R-b | A-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] iio: adc: xilinx-ams: fix out-of-bounds accesses when parsing channels
The driver sizes its channel array for 10 fixed and 21 external PL channels, but accepts external channel nodes numbered 20 to 50, and it never checks the remaining room while filling the array. Channels 20 to 29 are the fixed ones, so listing them adds duplicates and overflows the array.
Patch 1 limits the external channels in the binding to 30-50, as Sai pointed out. Patch 2 does the same in the driver and adds the bounds checks from v2.
Changes in v3:
- New patch 1: limit the binding to channels 30-50 (Sai)
- Patch 2: only accept channels 30-50, so a channel node can no longer duplicate a fixed channel (Sai), and add a static_assert() that ams_pl_channels[] holds the fixed plus the external channels
- Patch 2: rework the commit message around the duplicate channels
- Rebase on fixes-togreg (now on 7.4-rc1)
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/
Compile-tested only (W=1); I don't have ZynqMP hardware. dt_binding_check passes, and rejects a channel@25 node in the example.
Arnav Kapoor (2):
dt-bindings: iio: adc: xlnx,zynqmp-ams: limit external channels to
30-50
iio: adc: xilinx-ams: fix out-of-bounds accesses when parsing channels
.../bindings/iio/adc/xlnx,zynqmp-ams.yaml | 7 ++- drivers/iio/adc/xilinx-ams.c | 57 +++++++++++++++---- 2 files changed, 50 insertions(+), 14 deletions(-)
base-commit: c293f0db308fe76a0a9b0f6674cd2dea149b03aa
Signature · 1 line
2.53.0