CVE-2022-49338

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49338
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49338.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49338
Downstream
Related
Published
2025-02-26T02:10:56Z
Modified
2025-10-13T16:12:41.528095Z
Summary
net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules
Details

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

net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules

CT cleanup assumes that all tc rules were deleted first, and so is free to delete the CT shared resources (e.g the draction fwdaction which is shared for all tuples). But currently for uplink, this is happens in reverse, causing the below trace.

CT cleanup is called from: mlx5ecleanupreptx()->mlx5ecleanupuplinkreptx()-> mlx5ereptccleanup()->mlx5etceswcleanup()-> mlx5tcctclean()

Only afterwards, tc cleanup is called from: mlx5ecleanupreptx()->mlx5etchtcleanup() which would have deleted all the tc ct rules, and so delete all the offloaded tuples.

Fix this reversing the order of init and on cleanup, which will result in tc cleanup then ct cleanup.

[ 9443.593347] WARNING: CPU: 2 PID: 206774 at drivers/net/ethernet/mellanox/mlx5/core/steering/draction.c:1882 mlx5dractiondestroy+0x188/0x1a0 [mlx5core] [ 9443.593349] Modules linked in: actct nfflowtable rdmaucm(O) rdmacm(O) iwcm(O) ibipoib(O) ibcm(O) ibumad(O) mlx5core(O-) mlxfw(O) mlxdevm(O) auxiliary(O) ibuverbs(O) psample ibcore(O) mlxcompat(O) ipgre gre iptunnel actvlan bonding geneve esp6offload esp6 esp4offload esp4 acttunnelkey vxlan ip6udptunnel udptunnel actmirred actskbedit actgact clsflower schingress nfnetlinkcttimeout nfnetlink xfrmuser xfrmalgo 8021q garp stp ipmidevintf mrp ipmimsghandler llc openvswitch nsh nfconncount nfnat mstpciconf(O) dmmultipath sbsagwdt uiopdrvgenirq uio mlxbfpmc mlxbfpka mlxtrio mlxbootctl(O) bluefieldedac schfqcodel iptables ipv6 crcccitt btrfs zstdcompress raid10 raid456 asyncraid6recov asyncmemcpy asyncpq asyncxor asynctx xor xorneon raid6pq raid1 raid0 crct10difce i2cmlxbf gpiomlxbf2 mlxbfgige aesneonbs aesneonblk [last unloaded: mlx5ib] [ 9443.593419] CPU: 2 PID: 206774 Comm: modprobe Tainted: G O 5.4.0-1023.24.gc14613d-bluefield #1 [ 9443.593422] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS BlueField:143ebaf Jan 11 2022 [ 9443.593424] pstate: 20000005 (nzCv daif -PAN -UAO) [ 9443.593489] pc : mlx5dractiondestroy+0x188/0x1a0 [mlx5core] [ 9443.593545] lr : mlx5ctfssmfsdestroy+0x24/0x30 [mlx5core] [ 9443.593546] sp : ffff8000135dbab0 [ 9443.593548] x29: ffff8000135dbab0 x28: ffff0003a6ab8e80 [ 9443.593550] x27: 0000000000000000 x26: ffff0003e07d7000 [ 9443.593552] x25: ffff800009609de0 x24: ffff000397fb2120 [ 9443.593554] x23: ffff0003975c0000 x22: 0000000000000000 [ 9443.593556] x21: ffff0003975f08c0 x20: ffff800009609de0 [ 9443.593558] x19: ffff0003c8a13380 x18: 0000000000000014 [ 9443.593560] x17: 0000000067f5f125 x16: 000000006529c620 [ 9443.593561] x15: 000000000000000b x14: 0000000000000000 [ 9443.593563] x13: 0000000000000002 x12: 0000000000000001 [ 9443.593565] x11: ffff800011108868 x10: 0000000000000000 [ 9443.593567] x9 : 0000000000000000 x8 : ffff8000117fb270 [ 9443.593569] x7 : ffff0003ebc01288 x6 : 0000000000000000 [ 9443.593571] x5 : ffff800009591ab8 x4 : fffffe000f6d9a20 [ 9443.593572] x3 : 0000000080040001 x2 : fffffe000f6d9a20 [ 9443.593574] x1 : ffff8000095901d8 x0 : 0000000000000025 [ 9443.593577] Call trace: [ 9443.593634] mlx5dractiondestroy+0x188/0x1a0 [mlx5core] [ 9443.593688] mlx5ctfssmfsdestroy+0x24/0x30 [mlx5core] [ 9443.593743] mlx5tcctclean+0x34/0xa8 [mlx5core] [ 9443.593797] mlx5etceswcleanup+0x58/0x88 [mlx5core] [ 9443.593851] mlx5ereptccleanup+0x24/0x30 [mlx5core] [ 9443.593905] mlx5ecleanupreptx+0x6c/0x78 [mlx5core] [ 9443.593959] mlx5edetachnetdev+0x74/0x98 [mlx5core] [ 9443.594013] mlx5enetdevchangeprofile+0x70/0x180 [mlx5core] [ 9443.594067] mlx5enetdevattachnicprofile+0x34/0x40 [mlx5core] [ 9443.594122] mlx5evportrepunload+0x15c/0x1a8 [mlx5core] [ 9443.594177] mlx5eswitchunregistervportreps+0x228/0x298 [mlx5core] [ 9443.594231] mlx5erepremove+0x2c/0x38 ---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
d1a3138f7913014e0714cb1d3d44793d76fc38a1
Fixed
11bcc79f4bcd244145e6a2c04d5dc755303492a8
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d1a3138f7913014e0714cb1d3d44793d76fc38a1
Fixed
15ef9efa855cf405fadd78272e1e5d04e09a1cf3

Affected versions

v5.*

v5.17
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.18.1
v5.18.2
v5.18.3

Database specific

{
    "vanir_signatures": [
        {
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11bcc79f4bcd244145e6a2c04d5dc755303492a8",
            "deprecated": false,
            "id": "CVE-2022-49338-11719920",
            "digest": {
                "length": 192.0,
                "function_hash": "46720219539392986411572012810251583344"
            },
            "signature_type": "Function",
            "signature_version": "v1",
            "target": {
                "function": "mlx5e_cleanup_rep_tx",
                "file": "drivers/net/ethernet/mellanox/mlx5/core/en_rep.c"
            }
        },
        {
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@15ef9efa855cf405fadd78272e1e5d04e09a1cf3",
            "deprecated": false,
            "id": "CVE-2022-49338-2abca972",
            "digest": {
                "length": 192.0,
                "function_hash": "46720219539392986411572012810251583344"
            },
            "signature_type": "Function",
            "signature_version": "v1",
            "target": {
                "function": "mlx5e_cleanup_rep_tx",
                "file": "drivers/net/ethernet/mellanox/mlx5/core/en_rep.c"
            }
        },
        {
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@15ef9efa855cf405fadd78272e1e5d04e09a1cf3",
            "deprecated": false,
            "id": "CVE-2022-49338-514a9af2",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "92760594805372061718661969174213971369",
                    "307185839652669786893230588001369028760",
                    "321060386947186695689355296730040010121",
                    "51079742885009286953030853817434025977",
                    "199674760878704100578528842393120511703",
                    "13301835993106847086468495120657274169",
                    "128293499408611152304519747552076825518",
                    "121965604924827044634957809562853247347",
                    "92855360172604978909600925548608751594",
                    "189830290637691681888680912210785861459",
                    "312826373870637141132917395817346882965",
                    "203547391326982247761350752835413693935",
                    "260858362063924539700655516290124793865",
                    "231633326135608910718395608494267086389",
                    "164039324394941918722024440519520959673",
                    "185800907062052966136941227704103578193",
                    "56331238925754051112315536998179082751",
                    "315581800596685552599797388055007910291",
                    "171676401343596805072783073024753313115",
                    "113709671570695050222242996808250022685",
                    "147936095690205429181906770246255569862",
                    "35238250587823916719988103285529083373",
                    "339141410123759339124936845581647168810",
                    "107709520530075251051571151070598277572",
                    "57874582588240299674452615152910624486",
                    "277752112948046640551027738527599604735",
                    "201898855325361084492548719972422289437",
                    "67194323702361383782197312202693753909",
                    "290596623999706492555317857636505747158",
                    "163261938039202321688101519841669014004",
                    "18090602011259319361942890918699659400",
                    "231871801708298430204078316485818914579",
                    "322976240011708010651500108704343966682",
                    "190885178520776927590789900848953883901"
                ]
            },
            "signature_type": "Line",
            "signature_version": "v1",
            "target": {
                "file": "drivers/net/ethernet/mellanox/mlx5/core/en_rep.c"
            }
        },
        {
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11bcc79f4bcd244145e6a2c04d5dc755303492a8",
            "deprecated": false,
            "id": "CVE-2022-49338-965a94c7",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "92760594805372061718661969174213971369",
                    "307185839652669786893230588001369028760",
                    "321060386947186695689355296730040010121",
                    "51079742885009286953030853817434025977",
                    "199674760878704100578528842393120511703",
                    "13301835993106847086468495120657274169",
                    "128293499408611152304519747552076825518",
                    "121965604924827044634957809562853247347",
                    "92855360172604978909600925548608751594",
                    "189830290637691681888680912210785861459",
                    "312826373870637141132917395817346882965",
                    "203547391326982247761350752835413693935",
                    "260858362063924539700655516290124793865",
                    "231633326135608910718395608494267086389",
                    "164039324394941918722024440519520959673",
                    "185800907062052966136941227704103578193",
                    "56331238925754051112315536998179082751",
                    "315581800596685552599797388055007910291",
                    "171676401343596805072783073024753313115",
                    "113709671570695050222242996808250022685",
                    "147936095690205429181906770246255569862",
                    "35238250587823916719988103285529083373",
                    "339141410123759339124936845581647168810",
                    "107709520530075251051571151070598277572",
                    "57874582588240299674452615152910624486",
                    "277752112948046640551027738527599604735",
                    "201898855325361084492548719972422289437",
                    "67194323702361383782197312202693753909",
                    "290596623999706492555317857636505747158",
                    "163261938039202321688101519841669014004",
                    "18090602011259319361942890918699659400",
                    "231871801708298430204078316485818914579",
                    "322976240011708010651500108704343966682",
                    "190885178520776927590789900848953883901"
                ]
            },
            "signature_type": "Line",
            "signature_version": "v1",
            "target": {
                "file": "drivers/net/ethernet/mellanox/mlx5/core/en_rep.c"
            }
        },
        {
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@15ef9efa855cf405fadd78272e1e5d04e09a1cf3",
            "deprecated": false,
            "id": "CVE-2022-49338-c65eda01",
            "digest": {
                "length": 482.0,
                "function_hash": "218659060721336067417059863734049305617"
            },
            "signature_type": "Function",
            "signature_version": "v1",
            "target": {
                "function": "mlx5e_init_rep_tx",
                "file": "drivers/net/ethernet/mellanox/mlx5/core/en_rep.c"
            }
        },
        {
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11bcc79f4bcd244145e6a2c04d5dc755303492a8",
            "deprecated": false,
            "id": "CVE-2022-49338-ec68a669",
            "digest": {
                "length": 482.0,
                "function_hash": "218659060721336067417059863734049305617"
            },
            "signature_type": "Function",
            "signature_version": "v1",
            "target": {
                "function": "mlx5e_init_rep_tx",
                "file": "drivers/net/ethernet/mellanox/mlx5/core/en_rep.c"
            }
        }
    ]
}

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.18.0
Fixed
5.18.4