Critical Memory Management Vulnerability in Linux Kernel - CVE-2023-40791

linux Updated 02 Oct 2025

Summary

16/10/2023
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2023-40791: extract_user_to_sg in lib/scatterlist.c in the Linux kernel before 6.4.12 fails to unpin pages in a certain situation, as demonstrated by a WARNING for try_grab_page. Affects linux versions < 6.4.13-1. Fixed in 6.4.13-1. 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 Linux kernel is the core component of many operating systems, providing essential services for hardware and software interaction. It is known for its stability, performance, and security features. However, vulnerabilities can arise, impacting system integrity and security. CVE-2023-40791 is a significant issue that affects versions of the Linux kernel prior to 6.4.12, specifically related to memory management in the 'extract_user_to_sg' function.

Vulnerability Detail

CVE-2023-40791 is a vulnerability in the Linux kernel that occurs in the 'extract_user_to_sg' function located in 'lib/scatterlist.c'. This vulnerability fails to unpin pages under certain conditions, which can lead to memory leaks and potential system instability. The issue was identified before version 6.4.12, and it is critical as it may allow unauthorized access to memory, leading to data corruption or system crashes.

How To Fix

Minimum fixed version

6.4.13-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade linux

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

Currently, there are no specific workarounds mentioned for this vulnerability. The best course of action is to apply the patch by updating to the latest version of the Linux kernel.

Conclusion

CVE-2023-40791 is a critical vulnerability in the Linux kernel that requires immediate attention. Updating to the patched version is essential to maintain system security and stability. Utilizing tools like Vulert can help in monitoring vulnerabilities effectively.

See every vulnerability recorded for linux →

Share this vulnerability

FAQ

CVE-2023-40791 is a vulnerability in the Linux kernel that affects memory management, specifically in the 'extract_user_to_sg' function.

You can check if your system is affected by using tools like Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without any signup.

The risks include potential memory leaks, system instability, and unauthorized access to memory, which could lead to data corruption or crashes.

Yes, a patch is available in version 6.4.13-1 of the Linux kernel. It is recommended to update to this version or later.

If immediate updates are not possible, monitor your system closely for unusual behavior and consider isolating affected systems until the patch can be applied.

Related vulnerabilities

Recent vulnerabilities recorded for linux.

How To Fix

Minimum fixed version

6.4.13-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade linux

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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