[PATCH v1 4/4] staging: atomisp: add resolution limits to prevent DVS overflow
From: Siho Lee
Date: Mon May 25 2026 - 11:29:20 EST
ATOM_ISP_MAX_WIDTH and ATOM_ISP_MAX_HEIGHT are set to UINT_MAX, which
allows userspace to set arbitrarily large resolutions via VIDIOC_S_FMT.
This is the root enabler for the integer overflow in DVS table allocation
fixed in the previous commits.
Add reasonable limits (8192x8192) as a defense-in-depth measure. The
Intel Atom ISP hardware does not support resolutions beyond 8192x8192,
so this should not affect any real use case.
Fixes: a49d25364dfb ("staging/atomisp: add support for DVS")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Siho Lee <25esihoya@xxxxxxxxx>
---
drivers/staging/media/atomisp/pci/atomisp_internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h
b/drivers/staging/media/atomisp/pci/atomisp_internal.h
index 5a69580b8..bb2367d19 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_internal.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h
@@ -55,8 +55,8 @@
#define ATOM_ISP_MIN_WIDTH 4
#define ATOM_ISP_MIN_HEIGHT 4
-#define ATOM_ISP_MAX_WIDTH UINT_MAX
-#define ATOM_ISP_MAX_HEIGHT UINT_MAX
+#define ATOM_ISP_MAX_WIDTH 8192
+#define ATOM_ISP_MAX_HEIGHT 8192
/* sub-QCIF resolution */
#define ATOM_RESOLUTION_SUBQCIF_WIDTH 128
--
2.43.0