CVE-2022-50000

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-50000
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50000.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50000
Downstream
Published
2025-06-18T11:00:59Z
Modified
2025-10-21T11:43:54.367959Z
Summary
netfilter: flowtable: fix stuck flows on cleanup due to pending work
Details

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

netfilter: flowtable: fix stuck flows on cleanup due to pending work

To clear the flow table on flow table free, the following sequence normally happens in order:

1) gcstep work is stopped to disable any further stats/del requests. 2) All flow table entries are set to teardown state. 3) Run gcstep which will queue HW del work for each flow table entry. 4) Waiting for the above del work to finish (flush). 5) Run gc_step again, deleting all entries from the flow table. 6) Flow table is freed.

But if a flow table entry already has pending HW stats or HW add work step 3 will not queue HW del work (it will be skipped), step 4 will wait for the pending add/stats to finish, and step 5 will queue HW del work which might execute after freeing of the flow table.

To fix the above, this patch flushes the pending work, then it sets the teardown flag to all flows in the flowtable and it forces a garbage collector run to queue work to remove the flows from hardware, then it flushes this new pending work and (finally) it forces another garbage collector run to remove the entry from the software flowtable.

Stack trace: [47773.882335] BUG: KASAN: use-after-free in downread+0x99/0x460 [47773.883634] Write of size 8 at addr ffff888103b45aa8 by task kworker/u20:6/543704 [47773.885634] CPU: 3 PID: 543704 Comm: kworker/u20:6 Not tainted 5.12.0-rc7+ #2 [47773.886745] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009) [47773.888438] Workqueue: nfftoffloaddel flowoffloadworkhandler [nfflowtable] [47773.889727] Call Trace: [47773.890214] dumpstack+0xbb/0x107 [47773.890818] printaddressdescription.constprop.0+0x18/0x140 [47773.892990] kasanreport.cold+0x7c/0xd8 [47773.894459] kasancheckrange+0x145/0x1a0 [47773.895174] downread+0x99/0x460 [47773.899706] nfflowoffloadtuple+0x24f/0x3c0 [nfflowtable] [47773.907137] flowoffloadworkhandler+0x72d/0xbe0 [nfflowtable] [47773.913372] processonework+0x8ac/0x14e0 [47773.921325] [47773.921325] Allocated by task 592159: [47773.922031] kasansavestack+0x1b/0x40 [47773.922730] _kasankmalloc+0x7a/0x90 [47773.923411] tcfctflowtableget+0x3cb/0x1230 [actct] [47773.924363] tcfctinit+0x71c/0x1156 [actct] [47773.925207] tcfactioninit1+0x45b/0x700 [47773.925987] tcfactioninit+0x453/0x6b0 [47773.926692] tcfextsvalidate+0x3d0/0x600 [47773.927419] flchange+0x757/0x4a51 [clsflower] [47773.928227] tcnewtfilter+0x89a/0x2070 [47773.936652] [47773.936652] Freed by task 543704: [47773.937303] kasansavestack+0x1b/0x40 [47773.938039] kasansettrack+0x1c/0x30 [47773.938731] kasansetfreeinfo+0x20/0x30 [47773.939467] _kasanslabfree+0xe7/0x120 [47773.940194] slabfreefreelisthook+0x86/0x190 [47773.941038] kfree+0xce/0x3a0 [47773.941644] tcfctflowtablecleanup_work

Original patch description and stack trace by Paul Blakey.

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
c29f74e0df7a02b8303bcdce93a7c0132d62577a
Fixed
8fbdec08dbf7d7ab8e35bdc65eb4394bc82d1e26
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c29f74e0df7a02b8303bcdce93a7c0132d62577a
Fixed
89e135a36a9eb81412b5459df94a80995ce62eef
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c29f74e0df7a02b8303bcdce93a7c0132d62577a
Fixed
9afb4b27349a499483ae0134282cefd0c90f480f

Affected versions

v5.*

v5.10
v5.10-rc1
v5.10-rc2
v5.10-rc3
v5.10-rc4
v5.10-rc5
v5.10-rc6
v5.10-rc7
v5.11
v5.11-rc1
v5.11-rc2
v5.11-rc3
v5.11-rc4
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.7
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
v5.19.1
v5.19.2
v5.19.3
v5.19.4
v5.19.5
v5.4
v5.4-rc7
v5.4-rc8
v5.5
v5.5-rc1
v5.5-rc2
v5.5-rc3
v5.5-rc4
v5.5-rc5
v5.5-rc6
v5.5-rc7
v5.6
v5.6-rc1
v5.6-rc2
v5.6-rc3
v5.6-rc4
v5.6-rc5
v5.6-rc6
v5.6-rc7
v5.7
v5.7-rc1
v5.7-rc2
v5.7-rc3
v5.7-rc4
v5.7-rc5
v5.7-rc6
v5.7-rc7
v5.8
v5.8-rc1
v5.8-rc2
v5.8-rc3
v5.8-rc4
v5.8-rc5
v5.8-rc6
v5.8-rc7
v5.9
v5.9-rc1
v5.9-rc2
v5.9-rc3
v5.9-rc4
v5.9-rc5
v5.9-rc6
v5.9-rc7
v5.9-rc8

v6.*

v6.0-rc1

Database specific

vanir_signatures

[
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89e135a36a9eb81412b5459df94a80995ce62eef",
        "target": {
            "file": "include/net/netfilter/nf_flow_table.h"
        },
        "id": "CVE-2022-50000-0b3fbbb9",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "85366624623935242999205263762005783532",
                "318004872406028171222300736446657206554",
                "82186474439784697500198397987098636539",
                "274320860309312681616328964581576707467"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8fbdec08dbf7d7ab8e35bdc65eb4394bc82d1e26",
        "target": {
            "function": "nf_flow_table_free",
            "file": "net/netfilter/nf_flow_table_core.c"
        },
        "id": "CVE-2022-50000-2e4e5c18",
        "deprecated": false,
        "digest": {
            "function_hash": "281373254034432900350595223253852366661",
            "length": 346.0
        },
        "signature_version": "v1",
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8fbdec08dbf7d7ab8e35bdc65eb4394bc82d1e26",
        "target": {
            "file": "include/net/netfilter/nf_flow_table.h"
        },
        "id": "CVE-2022-50000-4055cbf5",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "85366624623935242999205263762005783532",
                "318004872406028171222300736446657206554",
                "82186474439784697500198397987098636539",
                "274320860309312681616328964581576707467"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89e135a36a9eb81412b5459df94a80995ce62eef",
        "target": {
            "file": "net/netfilter/nf_flow_table_core.c"
        },
        "id": "CVE-2022-50000-4d697aba",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "114751246830435082708110488123622877414",
                "95834422570841452535572842513596711736",
                "120443758790231434291273836977181794879",
                "53799696330955737385516270641755735067",
                "189978142510366619273815873562551497050",
                "273780067294213805647459748505439130615",
                "96801969381951491273380751330647915268",
                "291731587088027163759056791141653445405",
                "121841679109623143566969996365634274527"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9afb4b27349a499483ae0134282cefd0c90f480f",
        "target": {
            "file": "net/netfilter/nf_flow_table_offload.c"
        },
        "id": "CVE-2022-50000-65c335af",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "108864716891692588999073565978623843247",
                "299523844711810150368211271439907511182",
                "306703195081225718760004151205177565832"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8fbdec08dbf7d7ab8e35bdc65eb4394bc82d1e26",
        "target": {
            "file": "net/netfilter/nf_flow_table_offload.c"
        },
        "id": "CVE-2022-50000-785dc10f",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "108864716891692588999073565978623843247",
                "299523844711810150368211271439907511182",
                "306703195081225718760004151205177565832"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9afb4b27349a499483ae0134282cefd0c90f480f",
        "target": {
            "file": "include/net/netfilter/nf_flow_table.h"
        },
        "id": "CVE-2022-50000-78680622",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "85366624623935242999205263762005783532",
                "318004872406028171222300736446657206554",
                "82186474439784697500198397987098636539",
                "274320860309312681616328964581576707467"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8fbdec08dbf7d7ab8e35bdc65eb4394bc82d1e26",
        "target": {
            "file": "net/netfilter/nf_flow_table_core.c"
        },
        "id": "CVE-2022-50000-8f034fdc",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "114751246830435082708110488123622877414",
                "95834422570841452535572842513596711736",
                "120443758790231434291273836977181794879",
                "53799696330955737385516270641755735067",
                "189978142510366619273815873562551497050",
                "273780067294213805647459748505439130615",
                "96801969381951491273380751330647915268",
                "291731587088027163759056791141653445405",
                "121841679109623143566969996365634274527"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9afb4b27349a499483ae0134282cefd0c90f480f",
        "target": {
            "file": "net/netfilter/nf_flow_table_core.c"
        },
        "id": "CVE-2022-50000-99c5a4d7",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "114751246830435082708110488123622877414",
                "95834422570841452535572842513596711736",
                "120443758790231434291273836977181794879",
                "53799696330955737385516270641755735067",
                "189978142510366619273815873562551497050",
                "273780067294213805647459748505439130615",
                "96801969381951491273380751330647915268",
                "291731587088027163759056791141653445405",
                "121841679109623143566969996365634274527"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89e135a36a9eb81412b5459df94a80995ce62eef",
        "target": {
            "function": "nf_flow_table_free",
            "file": "net/netfilter/nf_flow_table_core.c"
        },
        "id": "CVE-2022-50000-b4f81aa9",
        "deprecated": false,
        "digest": {
            "function_hash": "281373254034432900350595223253852366661",
            "length": 346.0
        },
        "signature_version": "v1",
        "signature_type": "Function"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@89e135a36a9eb81412b5459df94a80995ce62eef",
        "target": {
            "file": "net/netfilter/nf_flow_table_offload.c"
        },
        "id": "CVE-2022-50000-c7b88581",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "108864716891692588999073565978623843247",
                "299523844711810150368211271439907511182",
                "306703195081225718760004151205177565832"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "signature_type": "Line"
    },
    {
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9afb4b27349a499483ae0134282cefd0c90f480f",
        "target": {
            "function": "nf_flow_table_free",
            "file": "net/netfilter/nf_flow_table_core.c"
        },
        "id": "CVE-2022-50000-f138fec9",
        "deprecated": false,
        "digest": {
            "function_hash": "281373254034432900350595223253852366661",
            "length": 346.0
        },
        "signature_version": "v1",
        "signature_type": "Function"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.15.64
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.19.6