From 61eb65ec2544804731cc7e42e14e577efeee0ee1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 8 Jul 2024 15:14:15 +0200 Subject: [PATCH] 6.6-stable patches added patches: media-dw2102-fix-a-potential-buffer-overflow.patch --- ...2102-fix-a-potential-buffer-overflow.patch | 35 +++++++++++++++++++ queue-6.6/series | 1 + 2 files changed, 36 insertions(+) create mode 100644 queue-6.6/media-dw2102-fix-a-potential-buffer-overflow.patch diff --git a/queue-6.6/media-dw2102-fix-a-potential-buffer-overflow.patch b/queue-6.6/media-dw2102-fix-a-potential-buffer-overflow.patch new file mode 100644 index 00000000000..1c972930b10 --- /dev/null +++ b/queue-6.6/media-dw2102-fix-a-potential-buffer-overflow.patch @@ -0,0 +1,35 @@ +From 1c73d0b29d04bf4082e7beb6a508895e118ee30d Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Mon, 29 Apr 2024 15:15:05 +0100 +Subject: media: dw2102: fix a potential buffer overflow + +From: Mauro Carvalho Chehab + +commit 1c73d0b29d04bf4082e7beb6a508895e118ee30d upstream. + +As pointed by smatch: + drivers/media/usb/dvb-usb/dw2102.c:802 su3000_i2c_transfer() error: __builtin_memcpy() '&state->data[4]' too small (64 vs 67) + +That seemss to be due to a wrong copy-and-paste. + +Fixes: 0e148a522b84 ("media: dw2102: Don't translate i2c read into write") + +Reported-by: Hans Verkuil +Reviewed-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/dvb-usb/dw2102.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/usb/dvb-usb/dw2102.c ++++ b/drivers/media/usb/dvb-usb/dw2102.c +@@ -786,7 +786,7 @@ static int su3000_i2c_transfer(struct i2 + + if (msg[j].flags & I2C_M_RD) { + /* single read */ +- if (1 + msg[j].len > sizeof(state->data)) { ++ if (4 + msg[j].len > sizeof(state->data)) { + warn("i2c rd: len=%d is too big!\n", msg[j].len); + num = -EOPNOTSUPP; + break; diff --git a/queue-6.6/series b/queue-6.6/series index fa453f0b0fb..cf9f0869095 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -114,3 +114,4 @@ net-stmmac-dwmac-qcom-ethqos-fix-error-array-size.patch bnx2x-fix-multiple-ubsan-array-index-out-of-bounds.patch arm64-dts-rockchip-fix-the-dcdc_reg2-minimum-voltage-on-quartz64-model-b.patch ima-avoid-blocking-in-rcu-read-side-critical-section.patch +media-dw2102-fix-a-potential-buffer-overflow.patch -- 2.47.3