CVE-2022-48845

See a problem?
Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48845
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48845.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48845
Related
Published
2024-07-16T13:15:11Z
Modified
2024-09-18T03:22:38.108389Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved:

MIPS: smp: fill in sibling and core maps earlier

After enabling CONFIGSCHEDCORE (landed during 5.14 cycle), 2-core 2-thread-per-core interAptiv (CPS-driven) started emitting the following:

[ 0.025698] CPU1 revision is: 0001a120 (MIPS interAptiv (multi)) [ 0.048183] ------------[ cut here ]------------ [ 0.048187] WARNING: CPU: 1 PID: 0 at kernel/sched/core.c:6025 schedcorecpustarting+0x198/0x240 [ 0.048220] Modules linked in: [ 0.048233] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.17.0-rc3+ #35 b7b319f24073fd9a3c2aa7ad15fb7993eec0b26f [ 0.048247] Stack : 817f0000 00000004 327804c8 810eb050 00000000 00000004 00000000 c314fdd1 [ 0.048278] 830cbd64 819c0000 81800000 817f0000 83070bf4 00000001 830cbd08 00000000 [ 0.048307] 00000000 00000000 815fcbc4 00000000 00000000 00000000 00000000 00000000 [ 0.048334] 00000000 00000000 00000000 00000000 817f0000 00000000 00000000 817f6f34 [ 0.048361] 817f0000 818a3c00 817f0000 00000004 00000000 00000000 4dc33260 0018c933 [ 0.048389] ... [ 0.048396] Call Trace: [ 0.048399] [<8105a7bc>] showstack+0x3c/0x140 [ 0.048424] [<8131c2a0>] dumpstacklvl+0x60/0x80 [ 0.048440] [<8108b5c0>] _warn+0xc0/0xf4 [ 0.048454] [<8108b658>] warnslowpathfmt+0x64/0x10c [ 0.048467] [<810bd418>] schedcorecpustarting+0x198/0x240 [ 0.048483] [<810c6514>] schedcpustarting+0x14/0x80 [ 0.048497] [<8108c0f8>] cpuhpinvokecallbackrange+0x78/0x140 [ 0.048510] [<8108d914>] notifycpustarting+0x94/0x140 [ 0.048523] [<8106593c>] startsecondary+0xbc/0x280 [ 0.048539] [ 0.048543] ---[ end trace 0000000000000000 ]--- [ 0.048636] Synchronize counters for CPU 1: done.

...for each but CPU 0/boot. Basic debug printks right before the mentioned line say:

[ 0.048170] CPU: 1, smt_mask:

So smtmask, which is sibling mask obviously, is empty when entering the function. This is critical, as schedcorecpustarting() calculates core-scheduling parameters only once per CPU start, and it's crucial to have all the parameters filled in at that moment (at least it uses cpusmtmask() which in fact is &cpu_sibling_map[cpu] on MIPS).

A bit of debugging led me to that setcpusiblingmap() performing the actual map calculation, was being invocated after notifycpustart(), and exactly the latter function starts CPU HP callback round (schedcorecpustarting() is basically a CPU HP callback). While the flow is same on ARM64 (maps after the notifier, although before calling setcpuonline()), x86 started calculating sibling maps earlier than starting the CPU HP callbacks in Linux 4.14 (see [0] for the reference). Neither me nor my brief tests couldn't find any potential caveats in calculating the maps right after performing delay calibration, but the WARN splat is now gone. The very same debug prints now yield exactly what I expected from them:

[ 0.048433] CPU: 1, smt_mask: 0-1

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=76ce7cfe35ef

References

Affected packages

Debian:11 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.113-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1
5.10.84-1
5.10.92-1~bpo10+1
5.10.92-1
5.10.92-2
5.10.103-1~bpo10+1
5.10.103-1
5.10.106-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.16.18-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.16.18-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}