SecurityContext

CVE-2024-53680: Linux Kernel - Use After Free

  • Cve: CVE-2024-53680
  • Name: Linux Kernel - Use After Free
  • Description: In the Linux kernel, the following vulnerability has been resolved: ipvs: fix UB due to uninitialized stack access in ip_vs_protocol_init() Under certain kernel configurations when building with Clang/LLVM, the compiler does not generate a return or jump as the terminator instruction for ip_vs_protocol_init(), triggering the following objtool warning during build time: vmlinux.o: warning: objtool: ip_vs_protocol_init() falls through to next function __initstub__kmod_ip_vs_rr__935_123_ip_vs_rr_init6() At runtime, this either causes an oops when trying to load the ipvs module or a boot-time panic if ipvs is built-in. This same issue has been reported by the Intel kernel test robot previously. Digging deeper into both LLVM and the kernel code reveals this to be a undefined behavior problem. ip_vs_protocol_init() uses a on-stack buffer of 64 chars to store the registered protocol names and leaves it uninitialized after definition. The function calls strnlen() when concatenating protocol names into the buffer. With CONFIG_FORTIFY_SOURCE strnlen() performs an extra step to check whether the last byte of the input char buffer is a null character (commit 3009f891bb9f ("fortify: Allow strlen() and strnlen() to pass compile-time known lengths")). This, together with possibly other configurations, cause the following IR to be generated: define hidden i32 @ip_vs_protocol_init() local_unnamed_addr #5 section ".init.text" align 16 !kcfi_type !29 { %1 = alloca [64 x i8], align 16 ... 14: ; preds = %11 %15 = getelementptr inbounds i8, ptr %1, i64 63 %16 = load i8, ptr %15, align 1 %17 = tail call i1 @llvm.is.constant.i8(i8 %16) %18 = icmp eq i8 %16, 0 %19 = select i1 %17, i1 %18, i1 false br i1 %19, label %20, label %23 20: ; preds = %14 %21 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #23 ... 23: ; preds = %14, %11, %20 %24 = call i64 @strnlen(ptr noundef nonnull dereferenceable(1) %1, i64 noundef 64) #24 ... } The above code calculates the address of the last char in the buffer (value %15) and then loads from it (value %16). Because the buffer is never initialized, the LLVM GVN pass marks value %16 as undefined: %13 = getelementptr inbounds i8, ptr %1, i64 63 br i1 undef, label %14, label %17 This gives later passes (SCCP, in particular) more DCE opportunities by propagating the undef value further, and eventually removes everything after the load on the uninitialized stack location: define hidden i32 @ip_vs_protocol_init() local_unnamed_addr #0 section ".init.text" align 16 !kcfi_type !11 { %1 = alloca [64 x i8], align 16 ... 12: ; preds = %11 %13 = getelementptr inbounds i8, ptr %1, i64 63 unreachable } In this way, the generated native code will just fall through to the next function, as LLVM does not generate any code for the unreachable IR instruction and leaves the function without a terminator. Zero the on-stack buffer to avoid this possible UB.
  • Impact: Potential kernel oops or panic, leading to system instability or denial of service.
  • Remediation: Zero initialize the on-stack buffer in ip_vs_protocol_init() to prevent undefined behavior.
  • Vulnerability type: use_after_free
  • Vulnerability impact: denial_of_service
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: medium
  • Cvss score: 5.5
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
  • Epss score: 0.00229
  • Epss percentile: 0.13766
  • Assignee: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  • Published at: 2025-01-11T13:15:25Z
  • Age in days: 682
  • Modified at: 2026-06-17T08:09:05Z
  • Patch available: yes
  • References total: 9
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2024-53680
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-908Use of Uninitialized Resource

References

Same in every row:

  • Source: nvd
UrlTags
https://git.kernel.org/stable/c/0b2cbed82b7c6504a8a0fbd181f92dd56b432c12Patch
https://git.kernel.org/stable/c/124834133b32f9386bb2d8581d9ab92f65e951e4Patch
https://git.kernel.org/stable/c/146b6f1112eb30a19776d6c323c994e9d67790dbPatch
https://git.kernel.org/stable/c/31d1ddc1ce8e8d3f101a679243abb42a313ee88aPatch
https://git.kernel.org/stable/c/48130002e64fd191b7d18efeb4d253fcc23e4688Patch
https://git.kernel.org/stable/c/664d0feab92495b6a27edc3d1119e232c0fe8b2bPatch
https://git.kernel.org/stable/c/d6e1776f51c95827142f1d7064118e255e2deec1Patch
https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html
https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html

Products

ProductAffectedPlatform boundSourcesUrl
linux:linux_kernel= 6.13 rc1; >= 6.7, < 6.12.5; >= 6.2, < 6.6.66; >= 5.16, < 6.1.120; >= 5.11, < 5.15.174; >= 5.5, < 5.10.231; >= 2.6.13, < 5.4.287; = 2.6.12 rc5; = 2.6.12 rc4; = 2.6.12 rc3; = 2.6.12; = 2.6.12 rc2nonvd/v1/products/linux/linux_kernel

Projects

RepositoryLink kindsIndexedUrl
torvalds/linuxcna_commit, commityes/v1/repositories/torvalds/linux

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Authentication required: yes
  • Exposed hosts: 10038339
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports