CVE-2022-49372

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49372
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49372.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49372
Related
Published
2025-02-26T07:01:13Z
Modified
2025-02-26T19:01:15.767215Z
Downstream
Summary
[none]
Details

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

tcp: tcprtxsynack() can be called from process context

Laurent reported the enclosed report [1]

This bug triggers with following coditions:

0) Kernel built with CONFIGDEBUGPREEMPT=y

1) A new passive FastOpen TCP socket is created. This FO socket waits for an ACK coming from client to be a complete ESTABLISHED one. 2) A socket operation on this socket goes through locksock() releasesock() dance. 3) While the socket is owned by the user in step 2), a retransmit of the SYN is received and stored in socket backlog. 4) At releasesock() time, the socket backlog is processed while in process context. 5) A SYNACK packet is cooked in response of the SYN retransmit. 6) -> tcprtx_synack() is called in process context.

Before blamed commit, tcprtxsynack() was always called from BH handler, from a timer handler.

Fix this by using TCPINCSTATS() & NETINCSTATS() which do not assume caller is in non preemptible context.

[1] BUG: using _thiscpuadd() in preemptible [00000000] code: epollpep/2180 caller is tcprtxsynack.part.0+0x36/0xc0 CPU: 10 PID: 2180 Comm: epollpep Tainted: G OE 5.16.0-0.bpo.4-amd64 #1 Debian 5.16.12-1~bpo11+1 Hardware name: Supermicro SYS-5039MC-H8TRF/X11SCD-F, BIOS 1.7 11/23/2021 Call Trace: <TASK> dumpstacklvl+0x48/0x5e checkpreemptiondisabled+0xde/0xe0 tcprtxsynack.part.0+0x36/0xc0 tcprtxsynack+0x8d/0xa0 ? kmemcachealloc+0x2e0/0x3e0 ? apparmorfileallocsecurity+0x3b/0x1f0 inetrtxsynack+0x16/0x30 tcpcheckreq+0x367/0x610 tcprcvstateprocess+0x91/0xf60 ? getnohztimertarget+0x18/0x1a0 ? locktimerbase+0x61/0x80 ? preemptcountadd+0x68/0xa0 tcpv4dorcv+0xbd/0x270 _releasesock+0x6d/0xb0 releasesock+0x2b/0x90 socksetsockopt+0x138/0x1140 ? _sysgetsockname+0x7e/0xc0 ? aaskperm+0x3e/0x1a0 _syssetsockopt+0x198/0x1e0 _x64syssetsockopt+0x21/0x30 dosyscall64+0x38/0xc0 entrySYSCALL64after_hwframe+0x44/0xae

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.127-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
5.10.113-1
5.10.120-1~bpo10+1
5.10.120-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.18.5-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.18.5-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}