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 57D941E6DEB for ; Wed, 4 Sep 2024 19:57:44 +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=1725479864; cv=none; b=Fh8kPRybCjc0OkkJlaxZDJ0cKuJ8qRggVOTvwvLE9mhRfWwTynXBdrvVXu9tIpSIfdUXaYIveCzFweIKySH8uASrTnhArI2Rqg1qe6azS+x7ZRiGxVXtBhupsZi8mIouU5h2xZ7+MiQzSaYVnwya1qZVQ4iaLUFvtx7r9kyc5nU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725479864; c=relaxed/simple; bh=rTPzHSe3Z81B2xWuq9A81/vLOcQCzmZuIGHGvuCgMo4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=anluwSOZ2c+3725J06ktUwkS7K/de+rIuFMV/k3o3XDcR0vvODagyA+5HO9b/kjbwBFLvOMC5dhn+6oaQfz8TAAWkKaIh/1asoZpiRMkktoraJc9/wMrYR7bbBlbX6vHlx4DPDMtzUC/1nMhYJ+Osf7PUQ7C3E5GFan4MCkc5w0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M+//QZY4; 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="M+//QZY4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C6CEC4CEC2; Wed, 4 Sep 2024 19:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725479863; bh=rTPzHSe3Z81B2xWuq9A81/vLOcQCzmZuIGHGvuCgMo4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=M+//QZY4kb6SHsjUtD5BHHdACvUd9p/yQZxStNpZ8nJi/ww2hd50EnA/BNDKrC83j wgwTDipoWSueYKFpA7tvIQ/qt9V6OK5JDSlHD9mdm4LqePxNBDKiBrbGwmqIEqpoiM zlo4GB+BRLrtYTJD3xMtNY+pKlpzt0pqclFwlNyU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-44981: workqueue: Fix UBSAN 'subtraction overflow' error in shift_and_mask() Date: Wed, 4 Sep 2024 21:56:46 +0200 Message-ID: <2024090444-CVE-2024-44981-2604@gregkh> X-Mailer: git-send-email 2.46.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=3738; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rTPzHSe3Z81B2xWuq9A81/vLOcQCzmZuIGHGvuCgMo4=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk3dtc86Nxx+56Hv9AWFuUZ07eG/TmWtm5qDFOwwNytX 9Rufmie0RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATue3DsGBNRNU5swmfRRNX Lltmqnpt5Z6exhiG2SypW+RvNmo95hWzOxyidUO6TcbFEQA= 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: workqueue: Fix UBSAN 'subtraction overflow' error in shift_and_mask() UBSAN reports the following 'subtraction overflow' error when booting in a virtual machine on Android: | Internal error: UBSAN: integer subtraction overflow: 00000000f2005515 [#1] PREEMPT SMP | Modules linked in: | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.10.0-00006-g3cbe9e5abd46-dirty #4 | Hardware name: linux,dummy-virt (DT) | pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : cancel_delayed_work+0x34/0x44 | lr : cancel_delayed_work+0x2c/0x44 | sp : ffff80008002ba60 | x29: ffff80008002ba60 x28: 0000000000000000 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: 0000000000000000 x22: 0000000000000000 x21: ffff1f65014cd3c0 | x20: ffffc0e84c9d0da0 x19: ffffc0e84cab3558 x18: ffff800080009058 | x17: 00000000247ee1f8 x16: 00000000247ee1f8 x15: 00000000bdcb279d | x14: 0000000000000001 x13: 0000000000000075 x12: 00000a0000000000 | x11: ffff1f6501499018 x10: 00984901651fffff x9 : ffff5e7cc35af000 | x8 : 0000000000000001 x7 : 3d4d455453595342 x6 : 000000004e514553 | x5 : ffff1f6501499265 x4 : ffff1f650ff60b10 x3 : 0000000000000620 | x2 : ffff80008002ba78 x1 : 0000000000000000 x0 : 0000000000000000 | Call trace: | cancel_delayed_work+0x34/0x44 | deferred_probe_extend_timeout+0x20/0x70 | driver_register+0xa8/0x110 | __platform_driver_register+0x28/0x3c | syscon_init+0x24/0x38 | do_one_initcall+0xe4/0x338 | do_initcall_level+0xac/0x178 | do_initcalls+0x5c/0xa0 | do_basic_setup+0x20/0x30 | kernel_init_freeable+0x8c/0xf8 | kernel_init+0x28/0x1b4 | ret_from_fork+0x10/0x20 | Code: f9000fbf 97fffa2f 39400268 37100048 (d42aa2a0) | ---[ end trace 0000000000000000 ]--- | Kernel panic - not syncing: UBSAN: integer subtraction overflow: Fatal exception This is due to shift_and_mask() using a signed immediate to construct the mask and being called with a shift of 31 (WORK_OFFQ_POOL_SHIFT) so that it ends up decrementing from INT_MIN. Use an unsigned constant '1U' to generate the mask in shift_and_mask(). The Linux kernel CVE team has assigned CVE-2024-44981 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 1211f3b21c2a and fixed in 6.10.7 with commit 90a6a844b2d9 Issue introduced in 6.10 with commit 1211f3b21c2a and fixed in 6.11-rc5 with commit 38f7e14519d3 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-44981 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: kernel/workqueue.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/90a6a844b2d9927d192758438a4ada33d8cd9de5 https://git.kernel.org/stable/c/38f7e14519d39cf524ddc02d4caee9b337dad703