CVE-2026-139529 — Linux Kernel — NONE Vulnerability
In the Linux kernel, the following vulnerability has been resolved: wifi: b43legacy: debugfs: NUL terminate string in debugfs The "buf" buffer is PAGE_SIZE and allocated with kzalloc(). We store a string from the user in it and then pass it to sscanf() in the write functions such as tsf_write_file(). The buffer is only used to store a number so we never come close to filling up the whole PAGE_SIZE. Reserve the last character of the page for a NUL terminator. This is debugfs so it's root only.
In the Linux kernel, the following vulnerability has been resolved: wifi: b43legacy: debugfs: NUL terminate string in debugfs The "buf" buffer is PAGE_SIZE and allocated with kzalloc(). We store a string from the user in it and then pass it to sscanf() in the write functions such as tsf_write_file(). The buffer is only used to store a number so we never come close to filling up the whole PAGE_SIZE. Reserve the last character of the page for a NUL terminator. This is debugfs so it's root only.
🎯 What is this vulnerability?
This vulnerability is a Missing NUL Termination (CWE-170) in the Linux kernel's b43legacy wireless driver, specifically within its debugfs interface.
Technical Flaw Analysis:
1. Context: The b43legacy driver provides support for older Broadcom 43xx wireless chips. It exposes a debug interface via the debugfs filesystem (typically mounted at /sys/kernel/debug/b43/).
2. The Bug: In functions like tsf_write_file(), the kernel allocates a buffer buf of size PAGE_SIZE (typically 4096 bytes) using kzalloc(). kzalloc zero-initializes the memory, so initially, the buffer is NUL-terminated.
3. The Trigger: The code accepts input from a user (root only) and stores it into buf. It then passes buf to sscanf().
4. The Failure Mode: While sscanf is generally safe if the input is well-formed, the vulnerability description highlights that the buffer is used to store a number. If an attacker provides a string that fills the buffer up to the exact limit or manipulates the parsing logic such that the final character is not explicitly NUL-terminated before subsequent string operations (or if sscanf leaves the buffer in a state where a trailing NUL is assumed but not guaranteed in edge cases of buffer overflow or specific parsing paths), subsequent string handling functions (like strlen, strcpy, or printk with %s) may read past the intended end of the string.
5. Specific Risk: Although kzalloc initializes to zero, if the input writing logic does not explicitly ensure the last byte is NUL after processing (e.g., if it writes PAGE_SIZE - 1 characters and assumes the last byte is NUL, but a logic error allows writing to the last byte or overwrites the NUL), it can lead to Information Disclosure (reading kernel stack/heap memory) or Denial of Service (kernel panic due to reading invalid memory addresses).
6. Severity Context: The CVSS score is 0.0 (NONE) because:
* Authentication: Requires root access (debugfs is restricted to root by default).
* Impact: Limited to local information disclosure or DoS.
* Exploitability: Highly complex and low practical impact for a local root user who already has full control of the system.
Note: This is a local vulnerability. It does not allow remote code execution (RCE) or unauthenticated access.
⚡ Attack Chain
Since this is a local, root-only vulnerability, the "attack chain" is primarily relevant for privilege escalation from a compromised root shell or lateral movement in multi-user environments where an attacker has already gained root.
1. Discovery & Reconnaissance
- Identify Hardware: Check if the system uses a Broadcom 43xx wireless chip supported by
b43legacy.
lspci | grep -i broadcom
lsmod | grep b43legacy0d2ecaf812728aca3089d7336784b78c7b4671b3).uname -rdebugfs is mounted and accessible.mount | grep debugfs
ls /sys/kernel/debug/b43/2. Exploitation (Illustrative PoC)
/sys/kernel/debug/b43/tsf (or similar debugfs file handled by tsf_write_file).PAGE_SIZE - 1 characters long (4095 bytes) without a trailing NUL, or manipulate the input to trigger a buffer over-read.# Generate a 4095-byte string of 'A's (no newline, no NUL)
# Note: In practice, the exact trigger depends on the specific sscanf format string
# and how the buffer is used post-parse. This is illustrative.
python3 -c "print('A' * 4095, end='')" > /tmp/payload.txt
# Write to the debugfs file
# This may trigger a kernel warning or info leak in dmesg
cat /tmp/payload.txt > /sys/kernel/debug/b43/tsf
# Check kernel logs for potential info leak or panic
dmesg | tail -n 20dmesg) reveals sensitive kernel memory contents (e.g., pointers, stack data) due to an over-read.
* Worst Case for System: Kernel panic (DoS) if the over-read accesses an unmapped page.3. Post-Exploitation
🌍 Real World Impact
b43legacy and debugfs enabled, they can leak kernel pointers to bypass KASLR, making it easier to exploit other, more severe kernel vulnerabilities.
* DoS Risk: A malicious root user can crash the system.🛡️ Remediation & Mitigation
1. Patching
0d2ecaf812728aca3089d7336784b78c7b4671b3.PAGE_SIZE buffer is explicitly set to \0 after input processing.
* Check your distribution's security advisories for the specific kernel version that includes this patch.2. Workarounds
debugfs.# Unmount debugfs
umount /sys/kernel/debug
# Prevent automatic mounting (edit /etc/fstab or systemd units)
# Comment out or remove the line mounting debugfsdebugfs is mounted with mode=0700 and owned by root:root.
* Use apparmor or SELinux to restrict access to /sys/kernel/debug/b43/ to specific processes only.
echo "blacklist b43legacy" > /etc/modprobe.d/blacklist-b43legacy.conf3. Detection
dmesg or /var/log/kern.log for kernel warnings related to b43legacy or debugfs.b43legacy: debugfs: buffer overflow or kernel: BUG: unable to handle page fault.
File Access Monitoring: Use auditd to monitor writes to /sys/kernel/debug/b43/.auditctl -w /sys/kernel/debug/b43/ -p w -k b43_debugfs_writedebugfs files.
* Kernel panics or reboots coinciding with wireless driver activity.⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query