Patch "media: dw2102: fix a potential buffer overflow" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: dw2102: fix a potential buffer overflow

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-dw2102-fix-a-potential-buffer-overflow.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2eb41b8b2c1a96d38030f9a36647ea2703247ec8
Author: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
Date:   Mon Apr 29 15:15:05 2024 +0100

    media: dw2102: fix a potential buffer overflow
    
    [ Upstream commit 1c73d0b29d04bf4082e7beb6a508895e118ee30d ]
    
    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 <hverkuil@xxxxxxxxx>
    Reviewed-by: Hans Verkuil <hverkuil@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index 10351308b0d02..f31d3835430e7 100644
--- 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 i2c_adapter *adap, struct i2c_msg msg[],
 
 			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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux