In the Linux kernel, the following vulnerability has been resolved:
net/mlx5: Fix a race on command flush flow
Fix a refcount use after free warning due to a race on command entry. Such race occurs when one of the commands releases its last refcount and frees its index and entry while another process running command flush flow takes refcount to this command entry. The process which handles commands flush may see this command as needed to be flushed if the other process released its refcount but didn't release the index yet. Fix it by adding the needed spin lock.
It fixes the following warning trace:
refcountt: addition on 0; use-after-free. WARNING: CPU: 11 PID: 540311 at lib/refcount.c:25 refcountwarnsaturate+0x80/0xe0 ... RIP: 0010:refcountwarnsaturate+0x80/0xe0 ... Call Trace: <TASK> mlx5cmdtriggercompletions+0x293/0x340 [mlx5core] mlx5cmdflush+0x3a/0xf0 [mlx5core] entererrorstate+0x44/0x80 [mlx5core] mlx5fwfatalreportererrwork+0x37/0xe0 [mlx5core] processonework+0x1be/0x390 workerthread+0x4d/0x3d0 ? rescuerthread+0x350/0x350 kthread+0x141/0x160 ? setkthreadstruct+0x40/0x40 retfrom_fork+0x1f/0x30 </TASK>
[
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a4017926eeea56c7540cc41b42106746ee8a0ee",
        "digest": {
            "line_hashes": [
                "79076623538187117950908175692062076395",
                "290922424143932155252702010240630740936",
                "56961532745726164775865872358396512037",
                "15614965601965089543596122349783218575",
                "313460796145340564994014995758949662986",
                "109293040847251519266221990633400092774",
                "214637854751881196193621714620809986412",
                "241886173398537150146408694320239014898",
                "54315900002945601891695499676505964545",
                "136648062059648711317273791184291286201",
                "140484360588002413213676061160450024121",
                "294813699926814683733737912084008330411",
                "296631002426467177233723857587244077333",
                "320897590386409924598213992435442681165",
                "339894875557498955766608261514373300926",
                "58715617143361339248996002572987490889",
                "3399263996533075566038084825262042404",
                "284669020385057173230502936907859558788",
                "85408284030735457980085049127750846289"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-011a81ae",
        "deprecated": false,
        "signature_type": "Line"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f3331bc17449f15832c31823f27573f4c0e13e5f",
        "digest": {
            "function_hash": "295251452087117952532649958207269112040",
            "length": 206.0
        },
        "target": {
            "function": "cmd_free_index",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-14f846f8",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a4017926eeea56c7540cc41b42106746ee8a0ee",
        "digest": {
            "function_hash": "108568756760279483118824836768881462014",
            "length": 276.0
        },
        "target": {
            "function": "cmd_ent_put",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-21cc7533",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@063bd355595428750803d8736a9bb7c8db67d42d",
        "digest": {
            "function_hash": "295251452087117952532649958207269112040",
            "length": 206.0
        },
        "target": {
            "function": "cmd_free_index",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-255b61e3",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f3331bc17449f15832c31823f27573f4c0e13e5f",
        "digest": {
            "line_hashes": [
                "79076623538187117950908175692062076395",
                "290922424143932155252702010240630740936",
                "56961532745726164775865872358396512037",
                "15614965601965089543596122349783218575",
                "313460796145340564994014995758949662986",
                "109293040847251519266221990633400092774",
                "214637854751881196193621714620809986412",
                "241886173398537150146408694320239014898",
                "54315900002945601891695499676505964545",
                "136648062059648711317273791184291286201",
                "140484360588002413213676061160450024121",
                "294813699926814683733737912084008330411",
                "296631002426467177233723857587244077333",
                "320897590386409924598213992435442681165",
                "339894875557498955766608261514373300926",
                "58715617143361339248996002572987490889",
                "3399263996533075566038084825262042404",
                "284669020385057173230502936907859558788",
                "85408284030735457980085049127750846289"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-29f29be6",
        "deprecated": false,
        "signature_type": "Line"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a4017926eeea56c7540cc41b42106746ee8a0ee",
        "digest": {
            "function_hash": "295251452087117952532649958207269112040",
            "length": 206.0
        },
        "target": {
            "function": "cmd_free_index",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-337e3283",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c519f769f555ff7d9d4ccba3497bbb589df360a",
        "digest": {
            "function_hash": "108568756760279483118824836768881462014",
            "length": 276.0
        },
        "target": {
            "function": "cmd_ent_put",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-78f37680",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@063bd355595428750803d8736a9bb7c8db67d42d",
        "digest": {
            "line_hashes": [
                "79076623538187117950908175692062076395",
                "290922424143932155252702010240630740936",
                "56961532745726164775865872358396512037",
                "15614965601965089543596122349783218575",
                "313460796145340564994014995758949662986",
                "109293040847251519266221990633400092774",
                "214637854751881196193621714620809986412",
                "241886173398537150146408694320239014898",
                "54315900002945601891695499676505964545",
                "136648062059648711317273791184291286201",
                "140484360588002413213676061160450024121",
                "294813699926814683733737912084008330411",
                "296631002426467177233723857587244077333",
                "320897590386409924598213992435442681165",
                "339894875557498955766608261514373300926",
                "58715617143361339248996002572987490889",
                "3399263996533075566038084825262042404",
                "284669020385057173230502936907859558788",
                "85408284030735457980085049127750846289"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-80d40efb",
        "deprecated": false,
        "signature_type": "Line"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f3331bc17449f15832c31823f27573f4c0e13e5f",
        "digest": {
            "function_hash": "108568756760279483118824836768881462014",
            "length": 276.0
        },
        "target": {
            "function": "cmd_ent_put",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-9bd4d508",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0401bfb27a91d7bdd74b1635c1aae57cbb128da6",
        "digest": {
            "line_hashes": [
                "79076623538187117950908175692062076395",
                "290922424143932155252702010240630740936",
                "56961532745726164775865872358396512037",
                "15614965601965089543596122349783218575",
                "313460796145340564994014995758949662986",
                "109293040847251519266221990633400092774",
                "214637854751881196193621714620809986412",
                "241886173398537150146408694320239014898",
                "54315900002945601891695499676505964545",
                "136648062059648711317273791184291286201",
                "140484360588002413213676061160450024121",
                "294813699926814683733737912084008330411",
                "296631002426467177233723857587244077333",
                "320897590386409924598213992435442681165",
                "339894875557498955766608261514373300926",
                "58715617143361339248996002572987490889",
                "3399263996533075566038084825262042404",
                "284669020385057173230502936907859558788",
                "85408284030735457980085049127750846289"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-a5d9dd35",
        "deprecated": false,
        "signature_type": "Line"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0401bfb27a91d7bdd74b1635c1aae57cbb128da6",
        "digest": {
            "function_hash": "295251452087117952532649958207269112040",
            "length": 206.0
        },
        "target": {
            "function": "cmd_free_index",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-b6f6cb89",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c519f769f555ff7d9d4ccba3497bbb589df360a",
        "digest": {
            "line_hashes": [
                "79076623538187117950908175692062076395",
                "290922424143932155252702010240630740936",
                "56961532745726164775865872358396512037",
                "15614965601965089543596122349783218575",
                "313460796145340564994014995758949662986",
                "109293040847251519266221990633400092774",
                "214637854751881196193621714620809986412",
                "241886173398537150146408694320239014898",
                "54315900002945601891695499676505964545",
                "136648062059648711317273791184291286201",
                "140484360588002413213676061160450024121",
                "294813699926814683733737912084008330411",
                "296631002426467177233723857587244077333",
                "320897590386409924598213992435442681165",
                "339894875557498955766608261514373300926",
                "58715617143361339248996002572987490889",
                "3399263996533075566038084825262042404",
                "284669020385057173230502936907859558788",
                "85408284030735457980085049127750846289"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-bc339d30",
        "deprecated": false,
        "signature_type": "Line"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@063bd355595428750803d8736a9bb7c8db67d42d",
        "digest": {
            "function_hash": "108568756760279483118824836768881462014",
            "length": 276.0
        },
        "target": {
            "function": "cmd_ent_put",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-d1b61e61",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c519f769f555ff7d9d4ccba3497bbb589df360a",
        "digest": {
            "function_hash": "295251452087117952532649958207269112040",
            "length": 206.0
        },
        "target": {
            "function": "cmd_free_index",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-d3156f76",
        "deprecated": false,
        "signature_type": "Function"
    },
    {
        "signature_version": "v1",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0401bfb27a91d7bdd74b1635c1aae57cbb128da6",
        "digest": {
            "function_hash": "108568756760279483118824836768881462014",
            "length": 276.0
        },
        "target": {
            "function": "cmd_ent_put",
            "file": "drivers/net/ethernet/mellanox/mlx5/core/cmd.c"
        },
        "id": "CVE-2022-48858-dcc8d6ce",
        "deprecated": false,
        "signature_type": "Function"
    }
]