Data Race Vulnerability in af_packet Package

Kernel Updated 02 Oct 2025

Summary

18/02/2022
N/A
No i
Unrated
Not published

GSD-2022-1000213: af_packet: fix data-race in packet_setsockopt / packet_setsockopt. Affects Kernel versions >= 47dceb8ecdc1c3ad1818dfea3d659a05b74c3fc2, < 32e179971085832f5335e308774a04dd1147a316. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The af_packet package is a component of the Linux Kernel, which is responsible for handling network packets at the kernel level. It provides a socket interface for packet capture and injection. The package is widely used in Linux-based systems for network monitoring, packet analysis, and other network-related tasks. However, a data race vulnerability has been discovered in the packet_setsockopt and packet_setsockopt functions of the af_packet package.

Vulnerability Detail

The data race vulnerability in the af_packet package arises from a race condition in the packet_setsockopt and packet_setsockopt functions. This vulnerability can be exploited by an attacker to manipulate the packet socket options in a multi-threaded environment, leading to unexpected behavior or a system crash. The vulnerability was introduced in version v4.3 of the Linux Kernel and has been fixed in version v5.10.97. It is important to note that the impact and attack plausibility of this vulnerability have not been proven yet.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, developers can consider using synchronization mechanisms, such as locks or atomic operations, to prevent concurrent access to the packet socket options in multi-threaded applications. By ensuring that only one thread modifies the options at a time, the data race vulnerability can be mitigated. Here is an example of using a mutex lock to protect the critical section:

#include <pthread.h>

pthread_mutex_t lock;

void set_packet_options() {
    pthread_mutex_lock(&lock);
    // Modify packet socket options
    pthread_mutex_unlock(&lock);
}

Conclusion

In conclusion, a data race vulnerability has been discovered in the af_packet package of the Linux Kernel. This vulnerability can be exploited by attackers in multi-threaded environments, leading to unexpected behavior or system crashes. It is crucial to update the Linux Kernel to version v5.10.97 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The af_packet package is a component of the Linux Kernel that provides a socket interface for packet capture and injection. It is commonly used for network monitoring and packet analysis.

A data race vulnerability occurs when multiple threads access shared data concurrently without proper synchronization. This can lead to unexpected behavior or crashes in multi-threaded applications.

An attacker can exploit the data race vulnerability in the af_packet package by manipulating the packet socket options in a multi-threaded environment. This can result in unexpected behavior or a system crash.

No, the impact and attack plausibility of this vulnerability have not been proven yet. Further analysis and testing are required to assess the actual risk.

To fix the data race vulnerability, it is recommended to update the Linux Kernel to version v5.10.97 or later. Applying relevant patches or upgrading the kernel package can address the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback