NFS: Use-after-free vulnerability in nfs4_init_client()

Kernel Updated 02 Oct 2025

Summary

30/06/2021
N/A
No i
Unrated
Not published

GSD-2021-1000906: NFS: Fix use-after-free in nfs4_init_client(). Affects Kernel versions >= 8dcbec6d20eb881ba368d0aebc3a8a678aebb1da, < 3e3c7ebbfac152d08be75c92802a64a1f6471a15. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Kernel package is a critical component of the Linux operating system that provides the core functionality and interfaces for various hardware and software components. It manages system resources, facilitates communication between hardware and software, and enables the execution of user applications. The NFS (Network File System) is a distributed file system protocol that allows remote file access over a network. It is implemented within the Kernel package and provides file sharing capabilities between systems. However, a use-after-free vulnerability has been identified in the nfs4_init_client() function, which can potentially be exploited by attackers to execute arbitrary code or cause a denial of service.

Vulnerability Detail

The use-after-free vulnerability in nfs4_init_client() arises from improper handling of client initialization in the NFS implementation. When a client is initialized, certain resources are allocated and associated with the client structure. However, due to a flaw in the code, these resources may be freed prematurely, leading to a use-after-free condition. An attacker can potentially exploit this vulnerability by triggering the use of the freed resources, resulting in a crash or the execution of malicious code within the Kernel context. The impact of this vulnerability can range from local privilege escalation to remote code execution, depending on the attacker's privileges and the system's configuration.

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, users can disable the NFS functionality or restrict access to NFS services from untrusted networks. This can be achieved by modifying the system's firewall rules or network configuration to block NFS traffic. However, this workaround may impact legitimate NFS usage and should only be considered if updating the Kernel is not immediately feasible.

Conclusion

The use-after-free vulnerability in nfs4_init_client() within the Kernel package can potentially be exploited by attackers to execute arbitrary code or cause a denial of service. It is crucial to update the Linux Kernel to version v5.4.126 or later to mitigate this vulnerability. Users can obtain the updated Kernel source code from the official Linux Kernel repository and follow the provided instructions for compilation and installation. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The NFS (Network File System) protocol is a distributed file system protocol that allows remote file access over a network. It enables clients to access files and directories on remote servers as if they were local.

The use-after-free vulnerability in nfs4_init_client() occurs due to improper handling of client initialization in the NFS implementation. Resources associated with the client structure are freed prematurely, leading to a use-after-free condition.

The potential consequences of this vulnerability include local privilege escalation, remote code execution, or denial of service. The severity of the impact depends on the attacker's privileges and the system's configuration.

To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.4.126 or later. The fix for this issue was implemented in commit 3e3c7ebbfac152d08be75c92802a64a1f6471a15.

As a temporary workaround, users can disable the NFS functionality or restrict access to NFS services from untrusted networks. This can be achieved by modifying the system's firewall rules or network configuration to block NFS traffic.

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