Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1389387lqa; Mon, 29 Apr 2024 07:17:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6pfoh7X5dVBSFHlNT8SIX9fyad6SF3uG5FaFzTJGEhmWQmplmpCAnrsk1ldJO1X2sZ62uxBVYWuC4bF0zZxRGaFyb5bxVxv5IV7ngrw== X-Google-Smtp-Source: AGHT+IFG6OGrW2SJEwQqprhP3cLRarEbr2cLCSgR4KdpaqWumJ+1S07xLLPiAo3ai0ohg+BTf9Ue X-Received: by 2002:a0c:eb0e:0:b0:6a0:bc42:5209 with SMTP id j14-20020a0ceb0e000000b006a0bc425209mr5701581qvp.26.1714400263124; Mon, 29 Apr 2024 07:17:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714400263; cv=pass; d=google.com; s=arc-20160816; b=GGyvWQMVdWE8LARDh8SG9apoN6k2voj7SkNvJLTtsdnEtoR8zwHioH4pcTTc6rj2kA SClu/4F7cWdVdlLMPNV02sKRzfO5cNKc3oRB4wXeUV+qG3LPRWzKg0QYYiRUg9KuJSit K0ee7ylNPAvpuZDFJKth3WUKC9TTdfV9XXub+dYb1a2WdlpEp/MIBPjwnEEOY8frV0xh gqhjhBWRRF1rFQ5UDgfqUdR4BNurDcaHR2lTZPvQq7XGb6605KPoNeEQtFQeTtLdY8Yf WsxslCLLPWN2Kgjl2VCMMfAQz/N5+XiLa+6uYakJo7kEFQtF6RuJVXrAdq49O6vbJjxP jtBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=2xovcVLqRo8w9Y+Pgevuh0pC2jzQPzG4ry+7uOU6HSE=; fh=PzIsvzLD+8muWVZHbwGNqC1NotocJq3EOYF85nF+/PI=; b=oYPoE7HYrjBp+RX4ohkeZ+t3OG62EgJqbTRwWT6UiAdgm+21cb+bT4IXXXxh7Rp0V/ ovmhB3dSYWjJjxz4CeDhaT6FfBYOH4UzPIcXorCl/FMsHqrbkkLH1gkL74wSoBO7ghRs 8UqIeTFQ4LoKDiU88mQ/HhuTyypC7IKETbI9hUN6MMoxEzrgPhz81MXuYYRuJAx47xLh MWQMhJJP/oEYQz5EGwRs/fYyur5tyzRMlTXurVOY5zzhy2fRxHvJcYP4kHAuV/tVfqZb L+ILVzp6nKe+FQ3JtGtU70lK4mfJ7lZMvVCu4rbICj1vYNVO/lFlAIh8SoSL5dHWCV+i nheA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vu3anpyg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iw2-20020a0562140f2200b0069b7957b689si26756761qvb.83.2024.04.29.07.17.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 07:17:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vu3anpyg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162430-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D59511C20F24 for ; Mon, 29 Apr 2024 14:17:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 337007BAEC; Mon, 29 Apr 2024 14:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vu3anpyg" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B3CD9468; Mon, 29 Apr 2024 14:17:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714400254; cv=none; b=Ez0CiQD5O3uUXKoPzH0wPgzJTaxr5tRAV+wRs10qHIxGlAjq3UX9MNjU1fgEdxGTrdxkRumh8N0TMxkpDZ77dhWGBcVGtUvSOa0yVw39VxSIKEnZzbpgPL5LLJhesO0Myb0sx+3IwgNItfoHCeOTGYHEM03xoFmBU8o9bxL79zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714400254; c=relaxed/simple; bh=nbkcu9WSxSxs8Z+1fSlDgrLBT1svm3YEGiy60ntZPH0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nvsjghqAALcOToht3ONAUKR+BtW99sPQz+Mp9ss132c+5Gmya2bw6pJ4EMPw+i+KJdCAh7b8SClnptUV27qJUX6w9i8ak5BPvHCpwp4pM61mdUr/WeSEfkx7Z4wcnyfn2cJZ+Ibc7ASCxvOYXAJc78DnYjrr0VyX9doY2oCW1U4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vu3anpyg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D620EC113CD; Mon, 29 Apr 2024 14:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714400253; bh=nbkcu9WSxSxs8Z+1fSlDgrLBT1svm3YEGiy60ntZPH0=; h=From:To:Cc:Subject:Date:From; b=Vu3anpygTqCpnZJAmEI4qV8DhN+cW+Rk9uJ2LPD/dw1DT4Cpv0RYXj1PhzMSdQlVt PBB7JR25fVzUZw3bZcUJpzRMWU0bfBkUyyendT4NBZb7Bj9gTrdBbJsfZbEctspISs Q5ZKByuXX/DtUqAxIPRQhp6VD3Qvrk9u8texwXwzezJy77o4jkjX0OzWJh5rv2AmBo 3557txnCpBInPIJSLGLMzF+r0VmCnHUTXOuBws8S3N9S2ugku0El1iLH1b7FeaHit5 njCEVpiObAKVMAwidcOTLapx4oxGu/4G6JLleAScSQbPAXoVZ8WxKmBJkZYD7IXDQ1 y0C7UnVvlPBTw== Received: from mchehab by mail.kernel.org with local (Exim 4.97.1) (envelope-from ) id 1s1Row-0000000C11A-1gJH; Mon, 29 Apr 2024 15:17:30 +0100 From: Mauro Carvalho Chehab To: Cc: Mauro Carvalho Chehab , "Hans Verkuil" , Hans Verkuil , Michael Bunk , Wei Chen , Yu Zhe , Zhang Shurong , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH] media: dw2102: fix a potential buffer overflow Date: Mon, 29 Apr 2024 15:17:23 +0100 Message-ID: <989d1befaf0ba99277ad7b1f6ef2d454afa6db51.1714400241.git.mchehab@kernel.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reported-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/dvb-usb/dw2102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c index 03b411ad64bb..79e2ccf974c9 100644 --- a/drivers/media/usb/dvb-usb/dw2102.c +++ b/drivers/media/usb/dvb-usb/dw2102.c @@ -789,7 +789,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; -- 2.44.0