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 70BF9296176 for ; Wed, 18 Jun 2025 11:16:48 +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=1750245408; cv=none; b=eM+Mo4QfhKenjU3Jl5xFk0OTGgoUXRyxpk0bCxlqDdhkySUmxicHVU9VPs6bSaEv24zt7kWnh/ekLi7CHR7kX6MfwoBFmmAJXuRLcuDf7XbIpuv4OcyE/yYgy8+rqExd7o4qad2VuGVKZ9AyOx1gWe63+8nGhp5pfkOjrv1vsYI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245408; c=relaxed/simple; bh=4o0YjpjPP3jFaTEAYbXjWPGfN3ifaqDgsMoeVmWJraY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J34uixPnn9p5U1Knpf/IS1IpIyts8LfJ7XCavraOrxpSTOUXGlrOLTzKHaytaym4xzRVfQ9UguTIlz80rYnr0m5FbDCV45sHm1ncAyYmqqeQ5h2Ewc0G8nK85XlNgyKFb2sN3jujfbVauRKdhW94N8ldEQFT9wzrfIsK7uQcLpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0wrvIGsg; 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="0wrvIGsg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC909C4CEE7; Wed, 18 Jun 2025 11:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245408; bh=4o0YjpjPP3jFaTEAYbXjWPGfN3ifaqDgsMoeVmWJraY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=0wrvIGsg13uDwY/ergSWxkWoU5iYP1xbsAswzCmCQVeTloiU+OFNpYn3nOidw3srA UEp1g81Bvo7aPQ1UkP0/cDuEJH52dZsqEts19XcYCVWd+opCFze5mr4q13TzxYFk9L Ce9e+j5iPXOBU1+FCrlPBAe7ITIQT7VIfa8FIabo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50223: LoongArch: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK Date: Wed, 18 Jun 2025 13:04:48 +0200 Message-ID: <2025061848-CVE-2022-50223-ece5@gregkh> X-Mailer: git-send-email 2.49.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=3989; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3Enf2cv1FZdrbf/HTttIHl8uxh1kNicAFAuAVfei6Ms=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc+bcOr5897RSkaNzpjz+qrImnu3ypIcLJM7uFpCL5 rn55qW7U0csC4MgE4OsmCLLl208R/dXHFL0MrQ9DTOHlQlkCAMXpwBMRFmSYX7Rmjmsx9QXm5zT qg3UYnfdlWZoeJthvv/n8zxPkteFuLyyF5pfXfxlD2fhVgA= 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: LoongArch: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected, cpu_max_bits_warn() generates a runtime warning similar as below while we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit) instead of NR_CPUS to iterate CPUs. [ 3.052463] ------------[ cut here ]------------ [ 3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0 [ 3.070072] Modules linked in: efivarfs autofs4 [ 3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052 [ 3.084034] Hardware name: Loongson Loongson-3A5000-7A1000-1w-V0.1-CRB/Loongson-LS3A5000-7A1000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V2.0.04082-beta7 04/27 [ 3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000 [ 3.109127] 9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430 [ 3.118774] 90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff [ 3.128412] 0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890 [ 3.138056] 0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa [ 3.147711] ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000 [ 3.157364] 900000000101c998 0000000000000004 9000000000ef7430 0000000000000000 [ 3.167012] 0000000000000009 000000000000006c 0000000000000000 0000000000000000 [ 3.176641] 9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286 [ 3.186260] 00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c [ 3.195868] ... [ 3.199917] Call Trace: [ 3.203941] [<90000000002086d8>] show_stack+0x38/0x14c [ 3.210666] [<9000000000cf846c>] dump_stack_lvl+0x60/0x88 [ 3.217625] [<900000000023d268>] __warn+0xd0/0x100 [ 3.223958] [<9000000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc [ 3.231150] [<9000000000210220>] show_cpuinfo+0x5e8/0x5f0 [ 3.238080] [<90000000004f578c>] seq_read_iter+0x354/0x4b4 [ 3.245098] [<90000000004c2e90>] new_sync_read+0x17c/0x1c4 [ 3.252114] [<90000000004c5174>] vfs_read+0x138/0x1d0 [ 3.258694] [<90000000004c55f8>] ksys_read+0x70/0x100 [ 3.265265] [<9000000000cfde9c>] do_syscall+0x7c/0x94 [ 3.271820] [<9000000000202fe4>] handle_syscall+0xc4/0x160 [ 3.281824] ---[ end trace 8b484262b4b8c24c ]--- The Linux kernel CVE team has assigned CVE-2022-50223 to this issue. Affected and fixed versions =========================== Fixed in 5.19.2 with commit 37268c7badd36f5381056d1651a6ee0b63b8ff3c Fixed in 6.0 with commit 28e112afa44ad0814120d41c68fa72372a2cd2c2 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-2022-50223 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: arch/loongarch/kernel/proc.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/37268c7badd36f5381056d1651a6ee0b63b8ff3c https://git.kernel.org/stable/c/28e112afa44ad0814120d41c68fa72372a2cd2c2