lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <aWANkxRApxDeReRW@stanley.mountain>
Date: Thu, 8 Jan 2026 23:03:31 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Shreeya Patel <shreeya.patel@...labora.com>
Cc: Dmitry Osipenko <dmitry.osipenko@...labora.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Dingxian Wen <shawn.wen@...k-chips.com>,
	Hans Verkuil <hverkuil@...nel.org>, linux-media@...r.kernel.org,
	kernel@...labora.com, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [PATCH] media: synopsys: hdmirx: fix integer overflow in
 hdmirx_get_edid()

The "edid->blocks" variable comes from the user via the ioctl.  It's
a u32 and "edid->start_block" is a u32 too.  The addition operation
could have an integer wrapping bug, so use the size_add() function to
prevent that.

Cc: stable@...r.kernel.org
Fixes: 7b59b132ad43 ("media: platform: synopsys: Add support for HDMI input driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
 drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index c3007e09bc9f..f054e30cbfb0 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -717,7 +717,7 @@ static int hdmirx_get_edid(struct file *file, void *fh, struct v4l2_edid *edid)
 	if (edid->start_block >= hdmirx_dev->edid_blocks_written || !edid->blocks)
 		return -EINVAL;
 
-	if (edid->start_block + edid->blocks > hdmirx_dev->edid_blocks_written)
+	if (size_add(edid->start_block, edid->blocks) > hdmirx_dev->edid_blocks_written)
 		edid->blocks = hdmirx_dev->edid_blocks_written - edid->start_block;
 
 	memcpy(edid->edid, hdmirx_dev->edid, edid->blocks * EDID_BLOCK_SIZE);
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ