CVE-2022-49888

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49888
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49888.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49888
Downstream
Related
Published
2025-05-01T14:10:33Z
Modified
2025-10-16T01:41:23.608835Z
Summary
arm64: entry: avoid kprobe recursion
Details

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

arm64: entry: avoid kprobe recursion

The cortexa76erratum1463225debughandler() function is called when handling debug exceptions (and synchronous exceptions from BRK instructions), and so is called when a probed function executes. If the compiler does not inline cortexa76erratum1463225debughandler(), it can be probed.

If cortexa76erratum1463225debughandler() is probed, any debug exception or software breakpoint exception will result in recursive exceptions leading to a stack overflow. This can be triggered with the ftrace multipleprobes selftest, and as per the example splat below.

This is a regression caused by commit:

6459b8469753e9fe ("arm64: entry: consolidate Cortex-A76 erratum 1463225 workaround")

... which removed the NOKPROBE_SYMBOL() annotation associated with the function.

My intent was that cortexa76erratum1463225debughandler() would be inlined into its caller, el1dbg(), which is marked noinstr and cannot be probed. Mark cortexa76erratum1463225debughandler() as _always_inline to ensure this.

Example splat prior to this patch (with recursive entries elided):

| # echo p cortexa76erratum1463225debughandler > /sys/kernel/debug/tracing/kprobeevents | # echo p doel0svc >> /sys/kernel/debug/tracing/kprobeevents | # echo 1 > /sys/kernel/debug/tracing/events/kprobes/enable | Insufficient stack space to handle exception! | ESR: 0x0000000096000047 -- DABT (current EL) | FAR: 0xffff800009cefff0 | Task stack: [0xffff800009cf0000..0xffff800009cf4000] | IRQ stack: [0xffff800008000000..0xffff800008004000] | Overflow stack: [0xffff00007fbc00f0..0xffff00007fbc10f0] | CPU: 0 PID: 145 Comm: sh Not tainted 6.0.0 #2 | Hardware name: linux,dummy-virt (DT) | pstate: 604003c5 (nZCv DAIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : arm64enterel1dbg+0x4/0x20 | lr : el1dbg+0x24/0x5c | sp : ffff800009cf0000 | x29: ffff800009cf0000 x28: ffff000002c74740 x27: 0000000000000000 | x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 | x23: 00000000604003c5 x22: ffff80000801745c x21: 0000aaaac95ac068 | x20: 00000000f2000004 x19: ffff800009cf0040 x18: 0000000000000000 | x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 | x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 | x11: 0000000000000010 x10: ffff800008c87190 x9 : ffff800008ca00d0 | x8 : 000000000000003c x7 : 0000000000000000 x6 : 0000000000000000 | x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000000043a4 | x2 : 00000000f2000004 x1 : 00000000f2000004 x0 : ffff800009cf0040 | Kernel panic - not syncing: kernel stack overflow | CPU: 0 PID: 145 Comm: sh Not tainted 6.0.0 #2 | Hardware name: linux,dummy-virt (DT) | Call trace: | dumpbacktrace+0xe4/0x104 | showstack+0x18/0x4c | dumpstacklvl+0x64/0x7c | dumpstack+0x18/0x38 | panic+0x14c/0x338 | testtaint+0x0/0x2c | panicbadstack+0x104/0x118 | handlebadstack+0x34/0x48 | _badstack+0x78/0x7c | arm64enterel1dbg+0x4/0x20 | el1h64synchandler+0x40/0x98 | el1h64sync+0x64/0x68 | cortexa76erratum1463225debughandler+0x0/0x34 ... | el1h64synchandler+0x40/0x98 | el1h64sync+0x64/0x68 | cortexa76erratum1463225debughandler+0x0/0x34 ... | el1h64synchandler+0x40/0x98 | el1h64sync+0x64/0x68 | cortexa76erratum1463225debughandler+0x0/0x34 | el1h64synchandler+0x40/0x98 | el1h64sync+0x64/0x68 | doel0svc+0x0/0x28 | el0t64synchandler+0x84/0xf0 | el0t64sync+0x18c/0x190 | Kernel Offset: disabled | CPU features: 0x0080,00005021,19001080 | Memory Limit: none | ---[ end Kernel panic - not syncing: kernel stack overflow ]---

With this patch, cortexa76erratum1463225debughandler() is inlined into el1dbg(), and el1_dbg() cannot be probed:

| # echo p cortexa76erratum1463225debughandler > /sys/kernel/debug/tracing/kprobeevents | sh: write error: No such file or directory | # grep -w cortexa76errat ---truncated---

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6459b8469753e9feaa8b34691d097cffad905931
Fixed
71d6c33fe223255f4416a01514da2c0bc3e283e7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6459b8469753e9feaa8b34691d097cffad905931
Fixed
db66629d43b2d12cb43b004a4ca6be1d03228e97
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
6459b8469753e9feaa8b34691d097cffad905931
Fixed
024f4b2e1f874934943eb2d3d288ebc52c79f55c

Affected versions

v5.*

v5.11
v5.11-rc5
v5.11-rc6
v5.11-rc7
v5.12
v5.12-rc1
v5.12-rc1-dontuse
v5.12-rc2
v5.12-rc3
v5.12-rc4
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.33
v5.15.34
v5.15.35
v5.15.36
v5.15.37
v5.15.38
v5.15.39
v5.15.4
v5.15.40
v5.15.41
v5.15.42
v5.15.43
v5.15.44
v5.15.45
v5.15.46
v5.15.47
v5.15.48
v5.15.49
v5.15.5
v5.15.50
v5.15.51
v5.15.52
v5.15.53
v5.15.54
v5.15.55
v5.15.56
v5.15.57
v5.15.58
v5.15.59
v5.15.6
v5.15.60
v5.15.61
v5.15.62
v5.15.63
v5.15.64
v5.15.65
v5.15.66
v5.15.67
v5.15.68
v5.15.69
v5.15.7
v5.15.70
v5.15.71
v5.15.72
v5.15.73
v5.15.74
v5.15.75
v5.15.76
v5.15.77
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.19
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8

v6.*

v6.0
v6.0-rc1
v6.0-rc2
v6.0-rc3
v6.0-rc4
v6.0-rc5
v6.0-rc6
v6.0-rc7
v6.0.1
v6.0.2
v6.0.3
v6.0.4
v6.0.5
v6.0.6
v6.0.7
v6.1-rc1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.12.0
Fixed
5.15.78
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.0.8