CVE-2026-32849 Overview
CVE-2026-32849 is a signed integer overflow vulnerability ([CWE-190]) in the NetBSD kernel. The flaw resides in the cryptodev_op() function within sys/opencrypto/cryptodev.c. The local variable iov_len is declared as a signed int but receives an assignment from the unsigned cop->dst_len field. When cop->dst_len exceeds INT_MAX, undefined behavior occurs. A local attacker with access to /dev/crypto and a compression session type can submit a crafted dst_len value to trigger a kernel panic. NetBSD addressed the issue in commit ec8451e.
Critical Impact
A local user with /dev/crypto access can crash the NetBSD kernel through a NULL pointer dereference caused by corrupted UIO pointer arithmetic when CONFIG_SVS is disabled.
Affected Products
- NetBSD versions prior to commit ec8451efc1565516aba9e7047e1a1a1ce7953a2f
- Systems exposing /dev/crypto to local users
- Kernels built with CONFIG_SVS disabled (heightened impact path)
Discovery Timeline
- 2026-05-18 - CVE-2026-32849 published to NVD
- 2026-05-18 - Last updated in NVD database
Technical Details for CVE-2026-32849
Vulnerability Analysis
The vulnerability stems from a type mismatch between the user-controlled cop->dst_len field and the kernel's internal iov_len variable. The crypt_op structure carries dst_len as an unsigned value supplied by userland through an ioctl against /dev/crypto. Inside cryptodev_op(), this value is copied into a signed int. Values greater than INT_MAX wrap into negative numbers when stored. The kernel subsequently uses this corrupted length in UIO (user I/O) pointer arithmetic without revalidating the result. When CONFIG_SVS (Separated Virtual address Space) is disabled, the resulting computation dereferences a NULL or invalid pointer, panicking the kernel.
Root Cause
The root cause is improper integer type handling [CWE-190]. The signed int iov_len cannot represent values above 2,147,483,647, while cop->dst_len is unsigned and accepts larger values. Sign conversion produces a negative length that propagates through subsequent buffer math.
Attack Vector
Exploitation requires local access and permission to open /dev/crypto. The attacker establishes a session of a compression algorithm type, then issues a CIOCCRYPT ioctl with dst_len set above INT_MAX. The resulting kernel panic produces a denial of service. No remote vector exists and confidentiality and integrity are not impacted.
// Patch metadata from the NetBSD upstream fix (commit ec8451e)
-/* $NetBSD: crypto.c,v 1.131 2022/06/26 22:52:30 riastradh Exp $ */
+/* $NetBSD: crypto.c,v 1.132 2026/04/29 14:49:51 christos Exp $ */
Source: NetBSD commit ec8451e
// Header signature changes hardening length parameters to size_t
-int cryptodev_mop(struct fcrypt *, struct crypt_n_op *, int, struct lwp *);
+int cryptodev_mop(struct fcrypt *, struct crypt_n_op *, size_t, struct lwp *);
-int cryptodev_msession(struct fcrypt *, struct session_n_op *, int);
+int cryptodev_msession(struct fcrypt *, struct session_n_op *, size_t);
Source: NetBSD commit ec8451e. The fix replaces signed int length parameters with size_t across the cryptodev interface to eliminate the overflow class entirely.
Detection Methods for CVE-2026-32849
Indicators of Compromise
- Unexpected kernel panics on NetBSD hosts referencing cryptodev_op or opencrypto in stack traces
- Crash dumps showing NULL pointer dereference within UIO buffer handling routines
- Local processes opening /dev/crypto followed by abrupt system reboot or hang
Detection Strategies
- Audit which local users and services hold read/write permissions on /dev/crypto
- Hunt for processes issuing CIOCGSESSION followed by CIOCCRYPT ioctls with abnormally large dst_len values
- Correlate kernel panic events with preceding userland activity against the crypto device
Monitoring Recommendations
- Forward kernel message buffers and savecore dumps to a centralized log store for post-incident review
- Alert on repeated unexpected reboots of NetBSD hosts within short time windows
- Track process execution that opens /dev/crypto from non-privileged accounts
How to Mitigate CVE-2026-32849
Immediate Actions Required
- Update NetBSD source trees to a revision including commit ec8451efc1565516aba9e7047e1a1a1ce7953a2f and rebuild the kernel
- Restrict /dev/crypto permissions so that only trusted accounts and services can open the device
- Enable CONFIG_SVS where supported to reduce the impact of corrupted kernel pointer arithmetic
Patch Information
The upstream fix is available in the NetBSD source repository at commit ec8451efc1565516aba9e7047e1a1a1ce7953a2f. The patch updates sys/opencrypto/crypto.c and sys/opencrypto/cryptodev_internal.h, converting affected length parameters from signed int to size_t. Additional context is published in the VulnCheck advisory and the NASM technical write-up.
Workarounds
- Tighten file mode on /dev/crypto (for example, chmod 600 /dev/crypto) until the patched kernel is deployed
- Disable or unload the cryptodev pseudo-device on systems that do not require userland access to in-kernel crypto
- Limit shell access on multi-user systems to reduce the local attacker population
# Restrict access to the crypto pseudo-device while preparing a patched kernel
ls -l /dev/crypto
chown root:wheel /dev/crypto
chmod 600 /dev/crypto
# Verify running kernel revision after patching
uname -v | grep -i netbsd
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

