CVE-2023-53022

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-53022
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53022.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2023-53022
Downstream
Published
2025-03-27T16:43:48Z
Modified
2025-10-16T14:47:47.260441Z
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
net: enetc: avoid deadlock in enetc_tx_onestep_tstamp()
Details

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

net: enetc: avoid deadlock in enetctxonestep_tstamp()

This lockdep splat says it better than I could:

================================ WARNING: inconsistent lock state

6.2.0-rc2-07010-ga9b9500ffaac-dirty #967 Not tainted

inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. kworker/1:3/179 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff3ec4036ce098 (xmitETHER#2){+.?.}-{3:3}, at: netiffreezequeues+0x5c/0xc0 {IN-SOFTIRQ-W} state was registered at: rawspinlock+0x5c/0xc0 schdirectxmit+0x148/0x37c devqueuexmit+0x528/0x111c ip6finishoutput2+0x5ec/0xb7c ip6finishoutput+0x240/0x3f0 ip6output+0x78/0x360 ndiscsendskb+0x33c/0x85c ndiscsendrs+0x54/0x12c addrconfrstimer+0x154/0x260 calltimerfn+0xb8/0x3a0 _runtimers.part.0+0x214/0x26c runtimersoftirq+0x3c/0x74 _dosoftirq+0x14c/0x5d8 dosoftirq+0x10/0x20 callonirqstack+0x2c/0x5c dosoftirqownstack+0x1c/0x30 irqexitrcu+0x168/0x1a0 irqexitrcu+0x10/0x40 el1interrupt+0x38/0x64 irq event stamp: 7825 hardirqs last enabled at (7825): [<ffffdf1f7200cae4>] exittokernelmode+0x34/0x130 hardirqs last disabled at (7823): [<ffffdf1f708105f0>] _dosoftirq+0x550/0x5d8 softirqs last enabled at (7824): [<ffffdf1f7081050c>] _dosoftirq+0x46c/0x5d8 softirqs last disabled at (7811): [<ffffdf1f708166e0>] _do_softirq+0x10/0x20

other info that might help us debug this: Possible unsafe locking scenario:

   CPU0
   ----

lock(xmitETHER#2); <Interrupt> lock(xmitETHER#2);

* DEADLOCK *

3 locks held by kworker/1:3/179: #0: ffff3ec400004748 ((wqcompletion)events){+.+.}-{0:0}, at: processonework+0x1f4/0x6c0 #1: ffff80000a0bbdc8 ((workcompletion)(&priv->txonesteptstamp)){+.+.}-{0:0}, at: processonework+0x1f4/0x6c0 #2: ffff3ec4036cd438 (&dev->txgloballock){+.+.}-{3:3}, at: netiftxlock+0x1c/0x34

Workqueue: events enetctxonesteptstamp Call trace: printusagebug.part.0+0x208/0x22c marklock+0x7f0/0x8b0 _lockacquire+0x7c4/0x1ce0 lockacquire.part.0+0xe0/0x220 lockacquire+0x68/0x84 rawspinlock+0x5c/0xc0 netiffreezequeues+0x5c/0xc0 netiftxlock+0x24/0x34 enetctxonesteptstamp+0x20/0x100 processonework+0x28c/0x6c0 worker_thread+0x74/0x450 kthread+0x118/0x11c

but I'll say it anyway: the enetctxonesteptstamp() work item runs in process context, therefore with softirqs enabled (i.o.w., it can be interrupted by a softirq). If we hold the netiftxlock() when there is an interrupt, and the NETTX softirq then gets scheduled, this will take the netiftxlock() a second time and deadlock the kernel.

To solve this, use netiftxlock_bh(), which blocks softirqs from running.

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
7294380c5211687aa4d66166984b152ee84caf5f
Fixed
8232e5a84d25a84a5cbda0f241a00793fb6eb608
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7294380c5211687aa4d66166984b152ee84caf5f
Fixed
e893dced1a18e77b1262f5c10169413f0ece0da7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7294380c5211687aa4d66166984b152ee84caf5f
Fixed
3c463721a73bdb57a913e0d3124677a3758886fc

Affected versions

v5.*

v5.12
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.78
v5.15.79
v5.15.8
v5.15.80
v5.15.81
v5.15.82
v5.15.83
v5.15.84
v5.15.85
v5.15.86
v5.15.87
v5.15.88
v5.15.89
v5.15.9
v5.15.90
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.1
v6.1-rc1
v6.1-rc2
v6.1-rc3
v6.1-rc4
v6.1-rc5
v6.1-rc6
v6.1-rc7
v6.1-rc8
v6.1.1
v6.1.2
v6.1.3
v6.1.4
v6.1.5
v6.1.6
v6.1.7
v6.1.8
v6.2-rc1
v6.2-rc2
v6.2-rc3

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.13.0
Fixed
5.15.91
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.9