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 D9DB4302151 for ; Thu, 18 Sep 2025 13:35:52 +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=1758202552; cv=none; b=KnVj+wzZiz8eLC8IcE49ybU8LlH1G24mptLGo+y6IyUfq4fVzft9rC7R2hFRTOgs/PW76VqIFcmlLHWWqNV9nyBzIZBLmKfsxia51b4w6Bqi9fuQcRH2IuWQaA6D3pVZ6w9c6C3Q8SfkwoW1Xf4brgJQaHGzbRyGyOtDiG/E86A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758202552; c=relaxed/simple; bh=8yq0Jztder5uyPJagFCF+Cplv8CuvbGW0VPAgYZTu8A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=g03jU/vqmVdDMZ5RsI1wyDte3Y86X+fMwbnmIlrBzyDbemacGgxSKaZ5RJMuM8NJ+8KTzlGsFrrF8seWmAkVn+k8xvpzSDOpIpJ4YXX4K/tjciD6T3F5vA+zSC1qoL0Df+IUmfC1egwQKvJcUUZi3D8E10aBC0+22Qc3dxcE4AM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vconjAYp; 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="vconjAYp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B9CCC4CEEB; Thu, 18 Sep 2025 13:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758202552; bh=8yq0Jztder5uyPJagFCF+Cplv8CuvbGW0VPAgYZTu8A=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vconjAYpsvNwbpS28UHeOU3Wy6NGnyVInaPJiebQf5hdgY8NDOtJwaYqvapSclhGv H49XGEIndEmbOrVG9uf3pec4TIq4dwXvyMuobDURiOkUWl9bi4hwst60rgD59jJCVV hHAHFt0qCio7bj1eZwLPeRm95C+3X6SaNrwWY85k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53376: scsi: mpi3mr: Use number of bits to manage bitmap sizes Date: Thu, 18 Sep 2025 15:34:21 +0200 Message-ID: <2025091856-CVE-2023-53376-d18b@gregkh> X-Mailer: git-send-email 2.51.0 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=3111; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=N9nXtPztLsMgnjuXBXnHfNulEO7WiIf94V74UYWWFL8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlnuFzWs7xeHb+t20SuQKMuvYy92OJm76zfF+eLy2Ue3 bFl/oZtHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR1ykMc0Vf+Mx6dtnV65TI QRmPM7FfY7Yut2KYK3FR5MqH5v87E94aMl03jvB3W3nyPwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: scsi: mpi3mr: Use number of bits to manage bitmap sizes To allocate bitmaps, the mpi3mr driver calculates sizes of bitmaps using byte as unit. However, bitmap helper functions assume that bitmaps are allocated using unsigned long as unit. This gap causes memory access beyond the bitmap sizes and results in "BUG: KASAN: slab-out-of-bounds". The BUG was observed at firmware download to eHBA-9600. Call trace indicated that the out-of-bounds access happened in find_first_zero_bit() called from mpi3mr_send_event_ack() for miroc->evtack_cmds_bitmap. To fix the BUG, do not use bytes to manage bitmap sizes. Instead, use number of bits, and call bitmap helper functions which take number of bits as arguments. For memory allocation, call bitmap_zalloc() instead of kzalloc() and krealloc(). For memory free, call bitmap_free() instead of kfree(). For zero clear, call bitmap_clear() instead of memset(). Remove three fields for bitmap byte sizes in struct scmd_priv which are no longer required. Replace the field dev_handle_bitmap_sz with dev_handle_bitmap_bits to keep number of bits of removepend_bitmap across resize. The Linux kernel CVE team has assigned CVE-2023-53376 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 824a156633dfdb0e17979a0d0bb2c757d1bb949c and fixed in 6.1.18 with commit 6a675a6d57d31da43d8da576465c1cd5d5b0bd3d Issue introduced in 5.14 with commit 824a156633dfdb0e17979a0d0bb2c757d1bb949c and fixed in 6.2.5 with commit 8ac713d2e9845e9234bb12ae5903040685d5aff9 Issue introduced in 5.14 with commit 824a156633dfdb0e17979a0d0bb2c757d1bb949c and fixed in 6.3 with commit 339e61565f81a6534afdc18fd854b2e2628bf5db 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-2023-53376 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/mpi3mr/mpi3mr.h drivers/scsi/mpi3mr/mpi3mr_fw.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/6a675a6d57d31da43d8da576465c1cd5d5b0bd3d https://git.kernel.org/stable/c/8ac713d2e9845e9234bb12ae5903040685d5aff9 https://git.kernel.org/stable/c/339e61565f81a6534afdc18fd854b2e2628bf5db