Lucene search

K
cveLinuxCVE-2024-35852
HistoryMay 17, 2024 - 3:15 p.m.

CVE-2024-35852

2024-05-1715:15:22
Linux
web.nvd.nist.gov
49
linux
kernel
vulnerability
memory leak
mlxsw
spectrum_acl_tcam
canceling rehash
migration
hints
security fix

AI Score

6.7

Confidence

Low

EPSS

0

Percentile

10.3%

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

mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work

The rehash delayed work is rescheduled with a delay if the number of
credits at end of the work is not negative as supposedly it means that
the migration ended. Otherwise, it is rescheduled immediately.

After “mlxsw: spectrum_acl_tcam: Fix possible use-after-free during
rehash” the above is no longer accurate as a non-negative number of
credits is no longer indicative of the migration being done. It can also
happen if the work encountered an error in which case the migration will
resume the next time the work is scheduled.

The significance of the above is that it is possible for the work to be
pending and associated with hints that were allocated when the migration
started. This leads to the hints being leaked [1] when the work is
canceled while pending as part of ACL region dismantle.

Fix by freeing the hints if hints are associated with a work that was
canceled while pending.

Blame the original commit since the reliance on not having a pending
work associated with hints is fragile.

[1]
unreferenced object 0xffff88810e7c3000 (size 256):
comm “kworker/0:16”, pid 176, jiffies 4295460353
hex dump (first 32 bytes):
00 30 95 11 81 88 ff ff 61 00 00 00 00 00 00 80 .0…a…
00 00 61 00 40 00 00 00 00 00 00 00 04 00 00 00 …a.@…
backtrace (crc 2544ddb9):
[<00000000cf8cfab3>] kmalloc_trace+0x23f/0x2a0
[<000000004d9a1ad9>] objagg_hints_get+0x42/0x390
[<000000000b143cf3>] mlxsw_sp_acl_erp_rehash_hints_get+0xca/0x400
[<0000000059bdb60a>] mlxsw_sp_acl_tcam_vregion_rehash_work+0x868/0x1160
[<00000000e81fd734>] process_one_work+0x59c/0xf20
[<00000000ceee9e81>] worker_thread+0x799/0x12c0
[<00000000bda6fe39>] kthread+0x246/0x300
[<0000000070056d23>] ret_from_fork+0x34/0x70
[<00000000dea2b93e>] ret_from_fork_asm+0x1a/0x30

Affected configurations

Vulners
Node
linuxlinux_kernelRange5.15.4.275
OR
linuxlinux_kernelRange5.5.05.10.216
OR
linuxlinux_kernelRange5.11.05.15.158
OR
linuxlinux_kernelRange5.16.06.1.90
OR
linuxlinux_kernelRange6.2.06.6.30
OR
linuxlinux_kernelRange6.7.06.8.9
OR
linuxlinux_kernelRange6.9.0
VendorProductVersionCPE
linuxlinux_kernel*cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c"
    ],
    "versions": [
      {
        "version": "c9c9af91f1d9",
        "lessThan": "51cefc9da400",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c9c9af91f1d9",
        "lessThan": "857ed800133f",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c9c9af91f1d9",
        "lessThan": "63d814d93c5c",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c9c9af91f1d9",
        "lessThan": "5bfe7bf9656e",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c9c9af91f1d9",
        "lessThan": "de1aaefa75be",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c9c9af91f1d9",
        "lessThan": "d72dd6fcd788",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c9c9af91f1d9",
        "lessThan": "fb4e2b70a719",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c"
    ],
    "versions": [
      {
        "version": "5.1",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "5.1",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.4.275",
        "lessThanOrEqual": "5.4.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.10.216",
        "lessThanOrEqual": "5.10.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.15.158",
        "lessThanOrEqual": "5.15.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.1.90",
        "lessThanOrEqual": "6.1.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.30",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.8.9",
        "lessThanOrEqual": "6.8.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.9",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]