CVE-2024-47659 Overview
CVE-2024-47659 is a Linux kernel vulnerability in the Smack (Simplified Mandatory Access Control Kernel) security module. The flaw causes incorrect labeling of TCP/IPv4 return packets, undermining Smack's mandatory access control guarantees. When a client with label foo connects to a server with label bar, returned packets carry foo instead of bar. This allows bar to write to foo without proper authorization, bypassing the mandatory access control policy. The same behavior affects DCCP connections. The regression was introduced in kernel release 2.6.29.4 and remained undetected for years. Affected component: linux:linux_kernel.
Critical Impact
An authenticated network attacker can bypass Smack mandatory access control policies, enabling unauthorized cross-label writes and integrity violations on hardened Linux systems.
Affected Products
- Linux Kernel versions containing the Smack LSM since release 2.6.29.4
- Debian LTS distributions using vulnerable kernel builds
- Any Linux distribution shipping Smack with TCP/IPv4 or DCCP networking enabled
Discovery Timeline
- 2024-10-09 - CVE-2024-47659 published to NVD
- 2025-01 - Debian LTS security announcement published
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-47659
Vulnerability Analysis
The Smack LSM enforces mandatory access control by attaching CIPSO (Commercial IP Security Option) labels to IP packets. For TCP/IPv4 connections, the kernel mirrored the incoming connection's label onto returned packets rather than applying the label of the listening socket. This mislabeling produces two distinct security failures.
First, response packets carry the client's label instead of the server's label, misrepresenting the origin of the data on the wire. Second, and more consequential, the server-side label writes to the client without a corresponding w (write) rule being evaluated at the client. The client never learns of the server label's existence, yet receives data attributed to its own label. This violates the integrity model that Smack is designed to enforce.
Root Cause
The root cause is a logic error in the Smack networking hook that selects the outbound CIPSO label for TCP/IPv4 (and DCCP) response traffic. The code path mirrored the peer label from the incoming socket instead of using the label bound to the local listening socket. The regression was introduced in Linux 2.6.29.4 with no documented rationale, indicating unintentional behavior. This is classified under [CWE-noinfo] pending detailed weakness categorization.
Attack Vector
Exploitation requires network access and low-privileged local access to instantiate a Smack label. An attacker on host C using label foo connects over TCP/IPv4 to a listener on host S running under label bar. If host S has the rule foo bar w defined, the connection succeeds. Return traffic from bar is then labeled foo, allowing bar to effectively write to foo without the reverse rule bar foo w being present. The same abuse works against DCCP listeners.
No public proof-of-concept has been released. The reproduction steps in the upstream commit message describe the behavior in sufficient detail for defenders and researchers to validate the flaw on test systems.
Detection Methods for CVE-2024-47659
Indicators of Compromise
- Return TCP/IPv4 or DCCP packets carrying a CIPSO label matching the initiating peer rather than the local listening service's Smack label
- Unexpected successful cross-label communication between processes running under distinct Smack labels without matching bidirectional w rules
- Audit records showing write operations against Smack-labeled sockets that lack corresponding authorization entries
Detection Strategies
- Capture packets between Smack-enabled hosts and validate CIPSO tags in return traffic against the expected server-side label
- Correlate AVC-style Smack denials and grants in kernel audit logs against the configured Smack rule set to identify implicit writes
- Enumerate running kernel versions across the fleet and flag hosts using Smack on unpatched builds
Monitoring Recommendations
- Enable kernel audit subsystem logging for Smack decisions and forward records to a centralized SIEM for correlation
- Monitor /sys/fs/smackfs/ runtime state for unexpected rule additions or label instantiations on production servers
- Track kernel package versions via configuration management to confirm patch deployment across all Smack-enabled hosts
How to Mitigate CVE-2024-47659
Immediate Actions Required
- Inventory Linux hosts with Smack enabled by checking for the smack LSM in /sys/kernel/security/lsm and prioritize patching
- Apply the upstream kernel patches referenced in the stable tree commits or upgrade to a distribution kernel that includes the fix
- Review existing Smack rule sets to identify any policies that may have relied on the incorrect mirroring behavior
Patch Information
The fix has been merged into the mainline and stable Linux kernel trees. Relevant stable commits include 0776bcf9cb6d, 0aea09e82eaf, 2fe209d0ad2e, 4be9fd15c3c8, 5b4b304f196c, a948ec993541, d3703fa94116, and d3f56c653c65. Debian LTS users should apply the update described in the Debian LTS Announcement. Consult the Linux kernel stable tree for the canonical patch series.
Workarounds
- Disable Smack and switch to an alternative LSM such as SELinux or AppArmor if immediate kernel patching is not feasible
- Restrict TCP/IPv4 and DCCP listeners under Smack-controlled labels to trusted network segments using firewall rules
- Remove or narrow Smack rules that grant w access across sensitive label pairs until the patched kernel is deployed
# Verify Smack is active and inspect current rules
cat /sys/kernel/security/lsm
cat /sys/fs/smackfs/load2
# Check running kernel version against patched builds
uname -r
# Apply distribution kernel updates (Debian example)
sudo apt update && sudo apt install --only-upgrade linux-image-$(uname -r | sed 's/[^-]*-[^-]*-//')
sudo reboot
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

