CVE-2022-48935

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48935
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48935.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48935
Downstream
Related
Published
2024-08-22T03:31:29Z
Modified
2025-10-21T08:52:18.549615Z
Summary
netfilter: nf_tables: unregister flowtable hooks on netns exit
Details

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

netfilter: nf_tables: unregister flowtable hooks on netns exit

Unregister flowtable hooks before they are releases via nftablesflowtable_destroy() otherwise hook core reports UAF.

BUG: KASAN: use-after-free in nfhookentries_grow+0x5a7/0x700 net/netfilter/core.c:142 net/netfilter/core.c:142 Read of size 4 at addr ffff8880736f7438 by task syz-executor579/3666

CPU: 0 PID: 3666 Comm: syz-executor579 Not tainted 5.16.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: <TASK> _dumpstack lib/dumpstack.c:88 [inline] _dumpstack lib/dumpstack.c:88 [inline] lib/dumpstack.c:106 dumpstacklvl+0x1dc/0x2d8 lib/dumpstack.c:106 lib/dumpstack.c:106 printaddressdescription+0x65/0x380 mm/kasan/report.c:247 mm/kasan/report.c:247 _kasanreport mm/kasan/report.c:433 [inline] _kasanreport mm/kasan/report.c:433 [inline] mm/kasan/report.c:450 kasanreport+0x19a/0x1f0 mm/kasan/report.c:450 mm/kasan/report.c:450 nfhookentriesgrow+0x5a7/0x700 net/netfilter/core.c:142 net/netfilter/core.c:142 _nfregisternethook+0x27e/0x8d0 net/netfilter/core.c:429 net/netfilter/core.c:429 nfregisternethook+0xaa/0x180 net/netfilter/core.c:571 net/netfilter/core.c:571 nftregisterflowtablenethooks+0x3c5/0x730 net/netfilter/nftablesapi.c:7232 net/netfilter/nftablesapi.c:7232 nftablesnewflowtable+0x2022/0x2cf0 net/netfilter/nftablesapi.c:7430 net/netfilter/nftablesapi.c:7430 nfnetlinkrcvbatch net/netfilter/nfnetlink.c:513 [inline] nfnetlinkrcvskbbatch net/netfilter/nfnetlink.c:634 [inline] nfnetlinkrcvbatch net/netfilter/nfnetlink.c:513 [inline] net/netfilter/nfnetlink.c:652 nfnetlinkrcvskbbatch net/netfilter/nfnetlink.c:634 [inline] net/netfilter/nfnetlink.c:652 nfnetlink_rcv+0x10e6/0x2550 net/netfilter/nfnetlink.c:652 net/netfilter/nfnetlink.c:652

_nftreleasehook() calls nftunregisterflowtablenethooks() which only unregisters the hooks, then after RCU grace period, it is guaranteed that no packets add new entries to the flowtable (no flow offload rules and flowtable hooks are reachable from packet path), so it is safe to call nfflowtablefree() which cleans up the remaining entries from the flowtable (both software and hardware) and it unbinds the flow_block.

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
ff4bf2f42a40e7dff28379f085b64df322c70b45
Fixed
e51f30826bc5384801df98d76109c94953d1df64
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ff4bf2f42a40e7dff28379f085b64df322c70b45
Fixed
8ffb8ac3448845f65634889b051bd65e4dee484b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ff4bf2f42a40e7dff28379f085b64df322c70b45
Fixed
b4fcc081e527aa2ce12e956912fc47e251f6bd27
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ff4bf2f42a40e7dff28379f085b64df322c70b45
Fixed
6069da443bf65f513bb507bb21e2f87cfb1ad0b6

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.10.1
v5.10.10
v5.10.100
v5.10.101
v5.10.102
v5.10.103
v5.10.104
v5.10.105
v5.10.106
v5.10.107
v5.10.108
v5.10.109
v5.10.11
v5.10.110
v5.10.111
v5.10.112
v5.10.113
v5.10.114
v5.10.115
v5.10.116
v5.10.117
v5.10.118
v5.10.119
v5.10.12
v5.10.120
v5.10.121
v5.10.122
v5.10.123
v5.10.124
v5.10.125
v5.10.126
v5.10.127
v5.10.128
v5.10.129
v5.10.13
v5.10.130
v5.10.131
v5.10.132
v5.10.133
v5.10.134
v5.10.135
v5.10.136
v5.10.137
v5.10.138
v5.10.139
v5.10.14
v5.10.140
v5.10.141
v5.10.142
v5.10.143
v5.10.144
v5.10.145
v5.10.146
v5.10.147
v5.10.148
v5.10.149
v5.10.15
v5.10.150
v5.10.151
v5.10.152
v5.10.153
v5.10.154
v5.10.155
v5.10.156
v5.10.157
v5.10.158
v5.10.159
v5.10.16
v5.10.160
v5.10.161
v5.10.162
v5.10.163
v5.10.164
v5.10.165
v5.10.166
v5.10.167
v5.10.168
v5.10.169
v5.10.17
v5.10.170
v5.10.171
v5.10.172
v5.10.173
v5.10.174
v5.10.175
v5.10.176
v5.10.177
v5.10.178
v5.10.179
v5.10.18
v5.10.180
v5.10.181
v5.10.182
v5.10.183
v5.10.184
v5.10.185
v5.10.186
v5.10.187
v5.10.188
v5.10.189
v5.10.19
v5.10.190
v5.10.191
v5.10.192
v5.10.193
v5.10.194
v5.10.195
v5.10.196
v5.10.197
v5.10.2
v5.10.20
v5.10.21
v5.10.22
v5.10.23
v5.10.24
v5.10.25
v5.10.26
v5.10.27
v5.10.28
v5.10.29
v5.10.3
v5.10.30
v5.10.31
v5.10.32
v5.10.33
v5.10.34
v5.10.35
v5.10.36
v5.10.37
v5.10.38
v5.10.39
v5.10.4
v5.10.40
v5.10.41
v5.10.42
v5.10.43
v5.10.44
v5.10.45
v5.10.46
v5.10.47
v5.10.48
v5.10.49
v5.10.5
v5.10.50
v5.10.51
v5.10.52
v5.10.53
v5.10.54
v5.10.55
v5.10.56
v5.10.57
v5.10.58
v5.10.59
v5.10.6
v5.10.60
v5.10.61
v5.10.62
v5.10.63
v5.10.64
v5.10.65
v5.10.66
v5.10.67
v5.10.68
v5.10.69
v5.10.7
v5.10.70
v5.10.71
v5.10.72
v5.10.73
v5.10.74
v5.10.75
v5.10.76
v5.10.77
v5.10.78
v5.10.79
v5.10.8
v5.10.80
v5.10.81
v5.10.82
v5.10.83
v5.10.84
v5.10.85
v5.10.86
v5.10.87
v5.10.88
v5.10.89
v5.10.9
v5.10.90
v5.10.91
v5.10.92
v5.10.93
v5.10.94
v5.10.95
v5.10.96
v5.10.97
v5.10.98
v5.10.99
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.3
v5.15.4
v5.15.5
v5.15.6
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.16.1
v5.16.10
v5.16.11
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
v5.17-rc1
v5.17-rc2
v5.17-rc3
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

Database specific

vanir_signatures

[
    {
        "id": "CVE-2022-48935-2313194f",
        "signature_type": "Line",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "291743393308643781887870968393914968881",
                "252711308867479820250531883088340076447",
                "173147649250159624831909232419686365711",
                "283763566172106631340647297121573629585",
                "271095343498865984287654139344755192792",
                "87766963288962034238917475058768199676",
                "265922938796364430572909324917201874588",
                "169095988770790471336969221035193000430",
                "42755004805213523066072633603893984314",
                "107558738418175451070635244590650307349",
                "152995714831555075405896044886030692202",
                "149557595400571564255801976621823925592"
            ],
            "threshold": 0.9
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e51f30826bc5384801df98d76109c94953d1df64",
        "target": {
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-2a659a5d",
        "signature_type": "Line",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "129869657837125599342136176526374642990",
                "192267460081581996738487330890908125072",
                "172445326765760462209335520933031061293",
                "24862904612621550812246295914889948213",
                "286010500747942577435421637726068822842",
                "126330266263669479986530877495908230170",
                "112142092730076539686258976321033421170"
            ],
            "threshold": 0.9
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ffb8ac3448845f65634889b051bd65e4dee484b",
        "target": {
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-31a37b69",
        "signature_type": "Function",
        "signature_version": "v1",
        "digest": {
            "length": 163.0,
            "function_hash": "286963554679163865742489967581576311655"
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4fcc081e527aa2ce12e956912fc47e251f6bd27",
        "target": {
            "function": "__nft_release_hook",
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-4d69e97c",
        "signature_type": "Function",
        "signature_version": "v1",
        "digest": {
            "length": 268.0,
            "function_hash": "35669439708744219206149205164427288742"
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e51f30826bc5384801df98d76109c94953d1df64",
        "target": {
            "function": "__nft_release_hooks",
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-5839bd43",
        "signature_type": "Line",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "129869657837125599342136176526374642990",
                "192267460081581996738487330890908125072",
                "172445326765760462209335520933031061293",
                "24862904612621550812246295914889948213",
                "286010500747942577435421637726068822842",
                "126330266263669479986530877495908230170",
                "112142092730076539686258976321033421170"
            ],
            "threshold": 0.9
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6069da443bf65f513bb507bb21e2f87cfb1ad0b6",
        "target": {
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-93abc62b",
        "signature_type": "Function",
        "signature_version": "v1",
        "digest": {
            "length": 163.0,
            "function_hash": "286963554679163865742489967581576311655"
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6069da443bf65f513bb507bb21e2f87cfb1ad0b6",
        "target": {
            "function": "__nft_release_hook",
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-a6d5d671",
        "signature_type": "Function",
        "signature_version": "v1",
        "digest": {
            "length": 163.0,
            "function_hash": "286963554679163865742489967581576311655"
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ffb8ac3448845f65634889b051bd65e4dee484b",
        "target": {
            "function": "__nft_release_hook",
            "file": "net/netfilter/nf_tables_api.c"
        }
    },
    {
        "id": "CVE-2022-48935-d06abb5b",
        "signature_type": "Line",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "129869657837125599342136176526374642990",
                "192267460081581996738487330890908125072",
                "172445326765760462209335520933031061293",
                "24862904612621550812246295914889948213",
                "286010500747942577435421637726068822842",
                "126330266263669479986530877495908230170",
                "112142092730076539686258976321033421170"
            ],
            "threshold": 0.9
        },
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4fcc081e527aa2ce12e956912fc47e251f6bd27",
        "target": {
            "file": "net/netfilter/nf_tables_api.c"
        }
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.198
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.26
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.12