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 DECEE19DF8B for ; Wed, 26 Feb 2025 01:57:27 +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=1740535048; cv=none; b=Z8/QHO7kfCHMLG3m/WpvMdx1vDty2i1S0ovLYb0SCoPJnumIuHInD0nLYPEei8UDqSfjYVfApkEV67SbuUx48gBHo4OP8wSuy/woCQBUMUpO76Lg0sCHw2ewR//QDr7HCzKVGaIXlNmCqQGdFDTiPwAcgAj3LUW9wpl4wkzMP+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535048; c=relaxed/simple; bh=q8Wh2CWEzv2IRfSKIRxznY13VbUAoBq3F66jCF9ZXoQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e3sSyuLMmNfDDfr3Hl3MdhzS9E7OTeiJwWWiZcQiK9JOVQkitl9sLPvaSpxftHZTn8frS/Y3N6T8Ari2RtBwJmwX+vtPUn/iceSGBcapu9fYdu9v18qS5UGQtzhR16KWk7FAeXyNwYDT/ZbdK60rI8XhM7G3blq4nYQMNGoU8Aw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EHS2ncm5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EHS2ncm5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599C3C4CEDD; Wed, 26 Feb 2025 01:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535047; bh=q8Wh2CWEzv2IRfSKIRxznY13VbUAoBq3F66jCF9ZXoQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=EHS2ncm5s/Nl/Yuh/U/kZp0NQRjejIVazJx9zggpfRtt+mBJ1xc+iLXSbI+jBoTST 9kAinb9MYZKHRXBqUXjDE3Z3pLToPBCm67Et1zrF2kpK2T7OVn26QV/efyS5GMtRKP 3MSFSabDzJgAxX7CV8Igy9CdH6zsoMSKH26BJfP4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47642: video: fbdev: nvidiafb: Use strscpy() to prevent buffer overflow Date: Wed, 26 Feb 2025 02:53:53 +0100 Message-ID: <2025022647-CVE-2021-47642-ae1b@gregkh> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3397; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=q8Wh2CWEzv2IRfSKIRxznY13VbUAoBq3F66jCF9ZXoQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7SrS/iEQpc+Qs7y4UkteavH5Wv6WUd+mcr1UVKxid3 z+8Z5XVEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOxTWBYMEHqDjfXt6SqSxem dk+/5VNYWSpxhWF+aRjT5x9rzRbtclp5qvHWmvue2gumAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: video: fbdev: nvidiafb: Use strscpy() to prevent buffer overflow Coverity complains of a possible buffer overflow. However, given the 'static' scope of nvidia_setup_i2c_bus() it looks like that can't happen after examiniing the call sites. CID 19036 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW) 1. fixed_size_dest: You might overrun the 48-character fixed-size string chan->adapter.name by copying name without checking the length. 2. parameter_as_source: Note: This defect has an elevated risk because the source argument is a parameter of the current function. 89 strcpy(chan->adapter.name, name); Fix this warning by using strscpy() which will silence the warning and prevent any future buffer overflows should the names used to identify the channel become much longer. The Linux kernel CVE team has assigned CVE-2021-47642 to this issue. Affected and fixed versions =========================== Fixed in 4.9.311 with commit 47e5533adf118afaf06d25a3e2aaaab89371b1c5 Fixed in 4.14.276 with commit 580e5d3815474b8349250c25c16416585a72c7fe Fixed in 4.19.238 with commit 72dd5c46a152136712a55bf026a9aa8c1b12b60d Fixed in 5.4.189 with commit 055cdd2e7b992921424d4daaa285ced787fb205f Fixed in 5.10.110 with commit 08dff482012758935c185532b1ad7d584785a86e Fixed in 5.15.33 with commit 9ff2f7294ab0f011cd4d1b7dcd9a07d8fdf72834 Fixed in 5.16.19 with commit 6a5226e544ac043bb2d8dc1bfe8920d02282f7cd Fixed in 5.17.2 with commit 41baa86b6c802cdc6ab8ff2d46c083c9be93de81 Fixed in 5.18 with commit 37a1a2e6eeeb101285cd34e12e48a881524701aa Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2021-47642 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/video/fbdev/nvidia/nv_i2c.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/47e5533adf118afaf06d25a3e2aaaab89371b1c5 https://git.kernel.org/stable/c/580e5d3815474b8349250c25c16416585a72c7fe https://git.kernel.org/stable/c/72dd5c46a152136712a55bf026a9aa8c1b12b60d https://git.kernel.org/stable/c/055cdd2e7b992921424d4daaa285ced787fb205f https://git.kernel.org/stable/c/08dff482012758935c185532b1ad7d584785a86e https://git.kernel.org/stable/c/9ff2f7294ab0f011cd4d1b7dcd9a07d8fdf72834 https://git.kernel.org/stable/c/6a5226e544ac043bb2d8dc1bfe8920d02282f7cd https://git.kernel.org/stable/c/41baa86b6c802cdc6ab8ff2d46c083c9be93de81 https://git.kernel.org/stable/c/37a1a2e6eeeb101285cd34e12e48a881524701aa