Lucene search

K
cvelistLinuxCVELIST:CVE-2024-26884
HistoryApr 17, 2024 - 10:27 a.m.

CVE-2024-26884 bpf: Fix hashtab overflow check on 32-bit arches

2024-04-1710:27:39
Linux
www.cve.org
6
linux kernel
vulnerability
hashtab overflow
bpf fix
round_pow_of_two
overflow check
devmap_hash type

AI Score

7.8

Confidence

High

EPSS

0

Percentile

5.1%

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

bpf: Fix hashtab overflow check on 32-bit arches

The hashtab code relies on roundup_pow_of_two() to compute the number of
hash buckets, and contains an overflow check by checking if the
resulting value is 0. However, on 32-bit arches, the roundup code itself
can overflow by doing a 32-bit left-shift of an unsigned long value,
which is undefined behaviour, so it is not guaranteed to truncate
neatly. This was triggered by syzbot on the DEVMAP_HASH type, which
contains the same check, copied from the hashtab code. So apply the same
fix to hashtab, by moving the overflow check to before the roundup.

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "kernel/bpf/hashtab.c"
    ],
    "versions": [
      {
        "version": "daaf427c6ab3",
        "lessThan": "33ec04cadb77",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "92c81fbb3ed2",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "64f00b4df059",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "3b08cfc65f07",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "a83fdaeaea36",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "8435f0961bf3",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "d817f0d34d92",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "a6fa75b5096c",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "daaf427c6ab3",
        "lessThan": "6787d916c2cf",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "kernel/bpf/hashtab.c"
    ],
    "versions": [
      {
        "version": "3.19",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "3.19",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "4.19.311",
        "lessThanOrEqual": "4.19.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.4.273",
        "lessThanOrEqual": "5.4.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.10.214",
        "lessThanOrEqual": "5.10.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.15.153",
        "lessThanOrEqual": "5.15.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.1.83",
        "lessThanOrEqual": "6.1.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.23",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.7.11",
        "lessThanOrEqual": "6.7.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.8.2",
        "lessThanOrEqual": "6.8.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.9",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

AI Score

7.8

Confidence

High

EPSS

0

Percentile

5.1%