NetBSD openat() System Call Vnode Reference Leak Lets Local Users Cause Denial of Service Conditions on the Target System
SecurityTracker Alert ID: 1039311|
SecurityTracker URL: http://securitytracker.com/id/1039311
(Links to External Site)
Date: Sep 11 2017
Denial of service via local system|
Fix Available: Yes Vendor Confirmed: Yes |
Version(s): 6.0 - 6.0.5, 6.1 - 6.1.4, 7.0 - 7.0.2, 7.1, 8.0 beta|
A vulnerability was reported in NetBSD. A local user can cause denial of service conditions on the target system.|
A local user can invoke a specially crafted openat() system call to exploit a vnode reference leak in the kernel to prevent the target volume from being unmounted. This can be repeated multiple times to corrupt the kernel heap.
Mateusz Guzik reported this vulnerability.
A local user can cause denial of service conditions on the target system.|
The vendor has issued a fix.|
The vendor advisory is available at:
Vendor URL: ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2017-006.txt.asc (Links to External Site)
Source Message Contents
Subject: NetBSD Security Advisory 2017-006: Vnode reference leak in the openat system call|
-----BEGIN PGP SIGNED MESSAGE-----
NetBSD Security Advisory 2017-006
Topic: Vnode reference leak in the openat system call
Version: NetBSD-current: source prior to Sun, July 9th 2017
NetBSD 8.0 beta: affected
NetBSD 7.1: affected
NetBSD 7.0 - 7.0.2: affected
NetBSD 6.1 - 6.1.4: not affected
NetBSD 6.0 - 6.0.5: not affected
Severity: Local privilege escalation
Fixed: NetBSD-current: Sun, July 9th 2017
NetBSD-8 branch: Mon, July 10th 2017
NetBSD-7-1 branch: Mon, July 10th 2017
NetBSD-7-0 branch: Mon, July 10th 2017
NetBSD-7 branch: Mon, July 10th 2017
Teeny versions released later than the fix date will contain the fix.
Please note that NetBSD releases prior to 6.0 are no longer supported.
It is recommended that all users upgrade to a supported release.
An easily exercisable error path in the kernel leaves behind an
unreclaimed reference to a vnode. This prevents unmounting the
affected volume, allowing local denial of service. It is likely that
tickling the weakness repeatedly can be used to corrupt the kernel
heap and thus gain kernel-level privileges, even with securelevel
When calling the openat system call using a file descriptor that does
not name a directory as the starting point for path lookup, a
reference to the underlying vnode is taken temporarily and then not
released when the error is discovered. Performing such a call often
enough results in overflowing the internal reference count and
corrupting the kernel heap.
Solutions and Workarounds
For all NetBSD versions, you need to obtain fixed kernel sources,
rebuild and install the new kernel, and reboot the system.
The fixed source may be obtained from the NetBSD CVS repository.
The following instructions briefly summarise how to upgrade your
kernel. In these instructions, replace:
ARCH with your architecture (from uname -m),
KERNCONF with the name of your kernel configuration file and
VERSION with the file version below
File versions containing the fixes:
FILE HEAD netbsd-8 netbsd-7 netbsd-7-1 netbsd-7-0
---- ---- -------- -------- ---------- ----------
1.208 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124
To update from CVS, re-build, and re-install the kernel:
# cd src
# cvs update -d -P -r VERSION sys/kern/vfs_lookup.c
# ./build.sh kernel=KERNCONF
# mv /netbsd /netbsd.old
# cp sys/arch/ARCH/compile/obj/KERNCONF/netbsd /netbsd
# shutdown -r now
For more information on how to do this, see:
Mateusz Guzik for noticing the issue, and David A. Holland for
deploying the fix.
2017-09-08 Initial release
Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at
Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/ .
Copyright 2017, The NetBSD Foundation, Inc. All Rights Reserved.
Redistribution permitted only in full, unmodified form.
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----