• CVE-2024-42161

发布时间: 2024年8月9日

修改时间: 2024年8月30日

概要

In the Linux kernel, the following vulnerability has been resolved: bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD [Changes from V1: - Use a default branch in the switch statement to initialize `val'.] GCC warns that `val' may be used uninitialized in the BPF_CRE_READ_BITFIELD macro, defined in bpf_core_read.h as: [...] unsigned long long val; \ [...] \ switch (__CORE_RELO(s, field, BYTE_SIZE)) { \ case 1: val = *(const unsigned char *)p; break; \ case 2: val = *(const unsigned short *)p; break; \ case 4: val = *(const unsigned int *)p; break; \ case 8: val = *(const unsigned long long *)p; break; \ } \ [...] val; \ } \ This patch adds a default entry in the switch statement that sets `val' to zero in order to avoid the warning, and random values to be used in case __builtin_preserve_field_info returns unexpected values for BPF_FIELD_BYTE_SIZE. Tested in bpf-next master. No regressions.

CVSS v3 指标

NVD openEuler
Confidentiality Low High
Attack Vector Local Local
CVSS评分 6.3 7.8
Attack Complexity Low Low
Privileges Required High Low
Scope Unchanged Unchanged
Integrity High High
User Interaction None None
Availability High High

安全公告

公告名 概要 发布时间
KylinSec-SA-2024-4973 kernel security update 2025年2月28日

影响产品

产品 状态
KY3.5.2 kernel Fixed
V6 kernel Fixed
KY3.5.3 kernel Fixed