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 2315C147C89 for ; Wed, 19 Jun 2024 13:37:19 +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=1718804239; cv=none; b=oyYrdA0HKiy8NZ3I7qU/E9nJLzNyMOPTkB9rw6yqUfDCeyYQ9yeulxGnsMuuUs/qeEo6XEPh3CHEnZ72W3REt23koS0wOnngeATgAMEDQtTi/NcT1//ezEEz7l02KHsGGU7VAol/kZNTj1rD0hkNqrQWYDZ5zeWB+M0mVqW9nMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718804239; c=relaxed/simple; bh=Vtoy2ggmhMus4mJQRrRxWkDpb6L9yQfPg7EtUnJ+7jM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FvkWKhLwr3LNKwFV8gyy39HMhfuUzG2PuHkl7C5tqKn9bzcoAmYADHv3zSDAeecBhr72JTgASArKXQjAz2CQdd1l7FE3Hl8pOhPu/pJ8lmw9EaqQaFhzGpJDzKYquDUX2tXRjaEDynku+lKTzfvQDjVTTzLdEQcdJIIV+PfNLgU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vnI6PDCS; 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="vnI6PDCS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99637C32786; Wed, 19 Jun 2024 13:37:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718804239; bh=Vtoy2ggmhMus4mJQRrRxWkDpb6L9yQfPg7EtUnJ+7jM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vnI6PDCSr0xyMyerAvzFcac8hPPIb2ZFQltn9z5b+MKySQVttTO7p/YEbBMKX7+GE Ui37qnfcHbKXatYj8IaSOzc73HAhCb8oER4R1rtUzgAT4Zak+Q9tCjDm+D2JwdcDhL zZdxqwxtY0cbatE7RnEULbgtT6de+A/pZnGiGv7k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38559: scsi: qedf: Ensure the copied buf is NUL terminated Date: Wed, 19 Jun 2024 15:36:08 +0200 Message-ID: <2024061953-CVE-2024-38559-3e03@gregkh> X-Mailer: git-send-email 2.45.2 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=3191; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Vtoy2ggmhMus4mJQRrRxWkDpb6L9yQfPg7EtUnJ+7jM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlF93bevFkd+bCDU3iN7aE97wvv+HYmGrWYyPdId2xp/ Tq9lrm+I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYiz84w369rf/OkD0YFzjkq +mZSVWlNGdPbGeYnXc0NLI1Vfnoo0V1a2dBewmKmdgYA 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: scsi: qedf: Ensure the copied buf is NUL terminated Currently, we allocate a count-sized kernel buffer and copy count from userspace to that buffer. Later, we use kstrtouint on this buffer but we don't ensure that the string is terminated inside the buffer, this can lead to OOB read when using kstrtouint. Fix this issue by using memdup_user_nul instead of memdup_user. The Linux kernel CVE team has assigned CVE-2024-38559 to this issue. Affected and fixed versions =========================== Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 4.19.316 with commit 1f84a2744ad8 Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 5.4.278 with commit a75001678e1d Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 5.10.219 with commit 769b9fd2af02 Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 5.15.161 with commit dccd97b39ab2 Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 6.1.93 with commit d93318f19d1e Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 6.6.33 with commit 563e60927592 Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 6.8.12 with commit 4907f5ad246f Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 6.9.3 with commit 177f43c6892e Issue introduced in 4.11 with commit 61d8658b4a43 and fixed in 6.10-rc1 with commit d0184a375ee7 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-2024-38559 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/scsi/qedf/qedf_debugfs.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/1f84a2744ad813be23fc4be99fb74bfb24aadb95 https://git.kernel.org/stable/c/a75001678e1d38aa607d5b898ec7ff8ed0700d59 https://git.kernel.org/stable/c/769b9fd2af02c069451fe9108dba73355d9a021c https://git.kernel.org/stable/c/dccd97b39ab2f2b1b9a47a1394647a4d65815255 https://git.kernel.org/stable/c/d93318f19d1e1a6d5f04f5d965eaa9055bb7c613 https://git.kernel.org/stable/c/563e609275927c0b75fbfd0d90441543aa7b5e0d https://git.kernel.org/stable/c/4907f5ad246fa9b51093ed7dfc7da9ebbd3f20b8 https://git.kernel.org/stable/c/177f43c6892e6055de6541fe9391a8a3d1f95fc9 https://git.kernel.org/stable/c/d0184a375ee797eb657d74861ba0935b6e405c62