Skip to content

media: ipu6: A few defensive fixes for ipu7 buttress, fw-com and mmu paths

Manik Bajpai linux-media 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesIn review
  2. v14 patches 1 replySuperseded

Changes in v2 from the cover letter

- ipu6_mmu_iova_to_phys(): this was found via code review, not from an observed crash (comparing against l2_map()/l2_unmap(), which already guard the equivalent lookup). Added a Fixes: tag pointing at the commit that introduced the unguarded lookup, but skipped a stable-tree backport since there's no confirmed real-world trigger (Sakari).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4media: ipu6: Free boot config on queue memory alloc failuredrivers/media/pci/intel/ipu6/ipu7-boot.c+1 -01 reply
2/4media: ipu6: Always run cleanup in ipu7 power on/off on timeoutdrivers/media/pci/intel/ipu6/ipu6-buttress.c+15 -91 reply
3/4media: ipu6: Validate fw-com queue indices before usedrivers/media/pci/intel/ipu6/ipu7-fw-com.c drivers/media/pci/intel/ipu6/ipu7-fw-com.h drivers/media/pci/intel/ipu6/ipu7-fw-isys.c+21 -50 replies
4/4media: ipu6: Fix NULL deref in ipu6_mmu_iova_to_phys()drivers/media/pci/intel/ipu6/ipu6-mmu.c+10 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] media: ipu6: A few defensive fixes for ipu7 buttress, fw-com and mmu paths

This series fixes several bugs found while reviewing the ipu7 buttress power on/off, fw-com and mmu paths: a boot-config leak on a queue memory allocation failure, a skipped cleanup step on a buttress power on/off timeout, unchecked firmware-supplied queue indices used in pointer arithmetic in ipu7_fw_com_get_token(), and a missing "is this iova mapped" check in ipu6_mmu_iova_to_phys() that could dereference an invalid pointer for an unmapped iova.

A related fix for a missing NULL check on the output pin queue in the ipu7 isr was dropped from this series, since an equivalent patch is already on the list:

https://lore.kernel.org/linux-media/[email protected]/

v2:
- ipu6_mmu_iova_to_phys(): this was found via code review, not from an observed crash (comparing against l2_map()/l2_unmap(), which already guard the equivalent lookup). Added a Fixes: tag pointing at the commit that introduced the unguarded lookup, but skipped a stable-tree backport since there's no confirmed real-world trigger (Sakari).

Manik Bajpai (4):
media: ipu6: Free boot config on queue memory alloc failure
media: ipu6: Always run cleanup in ipu7 power on/off on timeout
media: ipu6: Validate fw-com queue indices before use
media: ipu6: Fix NULL deref in ipu6_mmu_iova_to_phys()

 drivers/media/pci/intel/ipu6/ipu6-buttress.c | 24 ++++++++++++--------
 drivers/media/pci/intel/ipu6/ipu6-mmu.c      | 11 ++++++++-
 drivers/media/pci/intel/ipu6/ipu7-boot.c     |  1 +
 drivers/media/pci/intel/ipu6/ipu7-fw-com.c   | 14 +++++++++++-
 drivers/media/pci/intel/ipu6/ipu7-fw-com.h   |  5 +++-
 drivers/media/pci/intel/ipu6/ipu7-fw-isys.c  |  7 +++---
 6 files changed, 47 insertions(+), 15 deletions(-)
Signature · 1 line
2.53.0