{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-42161","id":"CVE-2024-42161","title":"bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD\n\n[Changes from V1:\n - Use a default branch in the switch statement to initialize `val'.]\n\nGCC warns that `val' may be used uninitialized in the\nBPF_CRE_READ_BITFIELD macro, defined in bpf_core_read.h as:\n\n\t[...]\n\tunsigned long long val;\t\t\t\t\t\t      \\\n\t[...]\t\t\t\t\t\t\t\t      \\\n\ts","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD\n\n[Changes from V1:\n - Use a default branch in the switch statement to initialize `val'.]\n\nGCC warns that `val' may be used uninitialized in the\nBPF_CRE_READ_BITFIELD macro, defined in bpf_core_read.h as:\n\n\t[...]\n\tunsigned long long val;\t\t\t\t\t\t      \\\n\t[...]\t\t\t\t\t\t\t\t      \\\n\tswitch (__CORE_RELO(s, field, BYTE_SIZE)) {\t\t\t      \\\n\tcase 1: val = *(const unsigned char *)p; break;\t\t\t      \\\n\tcase 2: val = *(const unsigned short *)p; break;\t\t      \\\n\tcase 4: val = *(const unsigned int *)p; break;\t\t\t      \\\n\tcase 8: val = *(const unsigned long long *)p; break;\t\t      \\\n        }       \t\t\t\t\t\t\t      \\\n\t[...]\n\tval;\t\t\t\t\t\t\t\t      \\\n\t}\t\t\t\t\t\t\t\t      \\\n\nThis patch adds a default entry in the switch statement that sets\n`val' to zero in order to avoid the warning, and random values to be\nused in case __builtin_preserve_field_info returns unexpected values\nfor BPF_FIELD_BYTE_SIZE.\n\nTested in bpf-next master.\nNo regressions.","published":"2024-07-30T07:47:03.136Z","updated":"2026-10-28T02:30:36.296508103Z","reserved":"2024-07-29T15:50:41.196Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":6.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H","rating":"medium","source":"NVD"},"metrics":[{"version":"3.1","score":6.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H","rating":"medium","source":"NVD"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ee26dade0e3bcd8a34ae7520e373fb69365fce7a","lessThan":"b694989bb13ed5f166e633faa1eb0f21c6d261a6","status":"affected","versionType":"git"},{"version":"ee26dade0e3bcd8a34ae7520e373fb69365fce7a","lessThan":"3364c2ed1c241989847f19cf83e3db903ce689e3","status":"affected","versionType":"git"},{"version":"ee26dade0e3bcd8a34ae7520e373fb69365fce7a","lessThan":"a21d76bd0b0d39518e9a4c19f6cf7c042a974aff","status":"affected","versionType":"git"},{"version":"ee26dade0e3bcd8a34ae7520e373fb69365fce7a","lessThan":"7e5471b5efebc30dd0bc035cda86693a5c73d45f","status":"affected","versionType":"git"},{"version":"ee26dade0e3bcd8a34ae7520e373fb69365fce7a","lessThan":"ff941a8449e712eaf7efca1a13bfb9afd3d99fc2","status":"affected","versionType":"git"},{"version":"ee26dade0e3bcd8a34ae7520e373fb69365fce7a","lessThan":"009367099eb61a4fc2af44d4eb06b6b4de7de6db","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.5","status":"affected"},{"version":"0","lessThan":"5.5","status":"unaffected","versionType":"semver"},{"version":"5.10.222","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.163","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.98","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.39","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.9.9","lessThanOrEqual":"6.9.*","status":"unaffected","versionType":"semver"},{"version":"6.10","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-908"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6","tags":["x_transferred","Patch","web"]},{"url":"https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3","tags":["x_transferred","Patch","web"]},{"url":"https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff","tags":["x_transferred","Patch","web"]},{"url":"https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f","tags":["x_transferred","Patch","web"]},{"url":"https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2","tags":["x_transferred","Patch","web"]},{"url":"https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db","tags":["x_transferred","Patch","web"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42161.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42161","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.0022,"epssPercentile":0.12736,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-42161","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42161","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-42161","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-42161","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}