CVE-2026-68178 in Linuxinfo

Summary

by MITRE • 08/10/2026

In the Linux kernel, the following vulnerability has been resolved:

misc: nsm: pin the module while the device is open

misc_open() installs a misc driver's file operations with fops_get(), which pins file_operations::owner before replacing the file's f_op. The NSM misc device leaves nsm_dev_fops.owner unset, so opening /dev/nsm does not take a module reference on the nsm driver.

If the driver is built as a module, an open file descriptor can therefore survive rmmod of the module that provides its ioctl callbacks. A later ioctl through that descriptor can call into unloaded module text.

Set nsm_dev_fops.owner to THIS_MODULE so the misc core holds the module while any /dev/nsm file descriptor is open, matching the lifetime expectation for the installed file operations.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 08/10/2026

This vulnerability exists in the Linux kernel's miscellaneous device driver framework where improper module reference handling creates a potential attack vector through use-after-free conditions. The issue specifically affects the Network Security Module (NSM) driver which implements a misc device at /dev/nsm. When a user opens this device file, the kernel's misc driver core should maintain a reference to the module that provides the file operations to ensure the module remains loaded during active usage.

The technical flaw occurs in the misc_open() function which properly handles module pinning by calling fops_get() to increment the reference count on file_operations::owner before installing the file operations. However, the NSM driver's file operations structure nsm_dev_fops has its owner field left uninitialized, meaning no module reference is taken when /dev/nsm is opened. This creates a race condition where a file descriptor remains valid even after the module containing the ioctl callbacks has been unloaded from memory.

This vulnerability directly relates to CWE-416 which describes use-after-free conditions and aligns with ATT&CK technique T1059.003 for command and scripting interpreter usage. The operational impact is significant as an attacker could potentially exploit this by first loading a malicious module, opening the NSM device file, then unloading the original module while keeping the file descriptor open. When subsequent ioctl operations are performed through this stale descriptor, they would execute code from the previously unloaded module memory space, potentially allowing for privilege escalation or arbitrary code execution.

The fix implemented involves setting nsm_dev_fops.owner to THIS_MODULE which ensures that the misc core framework properly tracks module references during device usage. This approach matches the expected lifetime behavior of installed file operations and prevents the scenario where ioctl callbacks could be invoked against unloaded module text. The solution follows established kernel security patterns for managing module lifecycle and reference counting, ensuring that modules remain loaded while they are actively providing services through open file descriptors.

This type of vulnerability represents a common class of kernel security issues related to improper reference counting and module management. The fix demonstrates proper kernel development practices by ensuring consistency with how other misc drivers handle module references. The mitigation approach prevents the use-after-free scenario by enforcing correct reference semantics at the kernel core level, which aligns with security best practices for kernel module design and lifecycle management as recommended in various kernel security guidelines and standards.

Responsible

Linux

Reservation

07/30/2026

Disclosure

08/10/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!