CVE-2021-29628

7.5 HIGH

📋 TL;DR

This vulnerability in FreeBSD kernels allows system calls to disable SMAP (Supervisor Mode Access Prevention) protections temporarily, creating a window where other kernel bugs could be exploited to gain elevated privileges. It affects FreeBSD 12.2 and 13.0 systems. Attackers could potentially combine this weakness with other vulnerabilities to execute kernel-level exploits.

💻 Affected Systems

Products:
  • FreeBSD
Versions: FreeBSD 13.0-STABLE before n245764-876ffe28796c, 12.2-STABLE before r369857, 13.0-RELEASE before p1, and 12.2-RELEASE before p7
Operating Systems: FreeBSD
Default Config Vulnerable: ⚠️ Yes
Notes: All default configurations of affected FreeBSD versions are vulnerable. The vulnerability is in the kernel itself.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker combines this SMAP bypass with another kernel vulnerability to achieve privilege escalation, gain root access, and potentially execute arbitrary code at kernel level, leading to complete system compromise.

🟠

Likely Case

Attackers use this vulnerability as part of a multi-stage exploit chain to bypass kernel protections and achieve privilege escalation, though this requires additional vulnerabilities to be present.

🟢

If Mitigated

With proper patching, the vulnerability is eliminated. Without patching but with strong network controls and minimal attack surface, the risk is reduced but not eliminated.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: HIGH

This vulnerability alone does not provide direct exploitation; it must be combined with other kernel bugs to craft a working exploit, making exploitation complex.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: FreeBSD 13.0-STABLE n245764-876ffe28796c, 12.2-STABLE r369857, 13.0-RELEASE p1, and 12.2-RELEASE p7

Vendor Advisory: https://security.FreeBSD.org/advisories/FreeBSD-SA-21:11.smap.asc

Restart Required: Yes

Instructions:

1. Update FreeBSD using the appropriate method (freebsd-update for RELEASE, source update for STABLE). 2. For RELEASE versions: Run 'freebsd-update fetch' then 'freebsd-update install'. 3. Reboot the system to load the patched kernel.

🧯 If You Can't Patch

  • Restrict access to affected systems to trusted users only and minimize attack surface by disabling unnecessary services.
  • Implement strict network segmentation and monitoring for suspicious kernel-level activity.

🔍 How to Verify

Check if Vulnerable:

Check FreeBSD version with 'uname -a' and compare against affected versions. For exact STABLE revisions, check system build information.

Check Version:

uname -a

Verify Fix Applied:

After patching and reboot, verify the kernel version is no longer in the vulnerable range using 'uname -a'.

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic logs, unexpected system crashes, or privilege escalation attempts in system logs.

Network Indicators:

  • Unusual outbound connections from kernel processes, though exploitation may not generate network traffic.

SIEM Query:

Search for kernel error messages related to SMAP or system call faults in FreeBSD system logs.

🔗 References

📤 Share & Export