From mboxrd@z Thu Jan 1 00:00:00 1970 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 D9E00199C7 for ; Tue, 2 Apr 2024 06:22:32 +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=1712038952; cv=none; b=ewLhH3jiBPNwnw1PbtNv83osQMQzHBvZSrFilhNB0W1H4yE28DxdWyslkTUb0JSK0hx73UpQAg8qTrHEuMkrhrkS/Etub+e5GoCox7PZUVyV834WYG2iZCwX7dlfzqFSnfQ1N28gUzc4jXWEKssn/6psl1NvxepGRyaQ/Nqo1mU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712038952; c=relaxed/simple; bh=U2UCkRhWXI8uGOirAijF7X2qtvkdkQNCChkkB67Spfw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=a3E1G6PO2nWCfB93OqB/FDuvcXUUEZ9CFYzrl7Vjc1H590BuGuKnPw9ni3L3WGP3x/eG4lez/jVHexQkPVdAUCkiF8CD4lrfEVfmnOSMD8PnHOJyY7yVJRJt6xwTLK6bkk+DgoEktgX8ZCp+4oeiZo3oePjJK/aJ63ybQIJp3h8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Kz3pEO9V; 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="Kz3pEO9V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECD12C433F1; Tue, 2 Apr 2024 06:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712038952; bh=U2UCkRhWXI8uGOirAijF7X2qtvkdkQNCChkkB67Spfw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Kz3pEO9VtwKKnT6X8hYmktPKb8ULn7d87Malc3UVFIoVh6IzJEmKW0XxVhJz6UIAC I9oEWs5jJjbhPcy/QuyklLRDdNexqxV7PbPhhBFNVojLr764pQj7WpjD5D06O7Q2jB xY/BsXQrO6JfMcBA2LiwSnc5g5UJRKCfQjTwaDmU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52630: blk-iocost: Fix an UBSAN shift-out-of-bounds warning Date: Tue, 2 Apr 2024 08:22:20 +0200 Message-ID: <2024040219-CVE-2023-52630-a529@gregkh> X-Mailer: git-send-email 2.44.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=3509; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=U2UCkRhWXI8uGOirAijF7X2qtvkdkQNCChkkB67Spfw=; b=owGbwMvMwCRo6H6F97bub03G02pJDGncS6T/ZL7+c3r+rwXPeG3Wtz15oL9EY77sLSGfIB7x5 5wWpdv7OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAibksZFhzd+v2vHleMgklj VpKANser1AOLfjLMlZpas3ip1GanwwET1nO58VlKtW1oAAA= 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: blk-iocost: Fix an UBSAN shift-out-of-bounds warning When iocg_kick_delay() is called from a CPU different than the one which set the delay, @now may be in the past of @iocg->delay_at leading to the following warning: UBSAN: shift-out-of-bounds in block/blk-iocost.c:1359:23 shift exponent 18446744073709 is too large for 64-bit type 'u64' (aka 'unsigned long long') ... Call Trace: dump_stack_lvl+0x79/0xc0 __ubsan_handle_shift_out_of_bounds+0x2ab/0x300 iocg_kick_delay+0x222/0x230 ioc_rqos_merge+0x1d7/0x2c0 __rq_qos_merge+0x2c/0x80 bio_attempt_back_merge+0x83/0x190 blk_attempt_plug_merge+0x101/0x150 blk_mq_submit_bio+0x2b1/0x720 submit_bio_noacct_nocheck+0x320/0x3e0 __swap_writepage+0x2ab/0x9d0 The underflow itself doesn't really affect the behavior in any meaningful way; however, the past timestamp may exaggerate the delay amount calculated later in the code, which shouldn't be a material problem given the nature of the delay mechanism. If @now is in the past, this CPU is racing another CPU which recently set up the delay and there's nothing this CPU can contribute w.r.t. the delay. Let's bail early from iocg_kick_delay() in such cases. The Linux kernel CVE team has assigned CVE-2023-52630 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 5160a5a53c0c and fixed in 5.10.210 with commit 9f56f3833117 Issue introduced in 5.10 with commit 5160a5a53c0c and fixed in 5.15.149 with commit 1e4d3f8bd880 Issue introduced in 5.10 with commit 5160a5a53c0c and fixed in 6.1.78 with commit e5dc63f01e02 Issue introduced in 5.10 with commit 5160a5a53c0c and fixed in 6.6.17 with commit 27b216130e64 Issue introduced in 5.10 with commit 5160a5a53c0c and fixed in 6.7.5 with commit cd33b330cb21 Issue introduced in 5.10 with commit 5160a5a53c0c and fixed in 6.8 with commit 2a427b49d029 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-52630 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: block/blk-iocost.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/9f56f38331171c9a19754004f0664686d67ee48d https://git.kernel.org/stable/c/1e4d3f8bd880e02932a9ea179f90bfa74fd2e899 https://git.kernel.org/stable/c/e5dc63f01e027721c29f82069f7e97e2149fa131 https://git.kernel.org/stable/c/27b216130e64651e76ed583742a1b4e4d08a67c3 https://git.kernel.org/stable/c/cd33b330cb21675189e747953845f5c3689e4912 https://git.kernel.org/stable/c/2a427b49d02995ea4a6ff93a1432c40fa4d36821