NetBSD compat Validation Flaws Let Local Users Crash the Kernel or Gain Elevated Privileges
SecurityTracker Alert ID: 1012611|
SecurityTracker URL: http://securitytracker.com/id/1012611
(Links to External Site)
Date: Dec 17 2004
Denial of service via local system, Execution of arbitrary code via local system, Root access via local system|
Fix Available: Yes Vendor Confirmed: Yes |
Version(s): prior to 2.0|
A vulnerability was reported in NetBSD in the compat functions. A local user can cause denial of service conditions or potentially gain elevated privileges.|
The vendor reported that some of the functions in /usr/src/sys/compat/* do not properly validate user-supplied data before executing a kernel syscall.
Several functions do not properly validate signal numbers. A local user can cause large signal numbers to be passed to certain syscall functions to cause the kernel to crash.
Several buffer overflows exist. At least one of the buffer overflows allows a local user to gain root privileges.
The vendor credits Evgeny Demidov with reporting this flaw (his advisory is available at http://gleg.net/advisory_netbsd2.shtml).
The vendor was notified on October 12, 2004.
A local user can cause the kernel to crash.|
A local user can gain root privileges.
Version 2.0 includes the fix. The NetBSD-current branch was fixed as of Oct 28, 2004, the NetBSD-2.0 branch was fixed as of Nov 13, 2004, and the NetBSD-1.6 branch was fixed as of Dec 17, 2004. The vendor plans to include the fix in the pending version 1.6.3.|
Instructions on upgrading kernel binaries are provided in the vendor's advisory, available at:
Vendor URL: www.NetBSD.org/Security/ (Links to External Site)
Boundary error, Input validation error|
Source Message Contents
Subject: NetBSD Security Advisory 2004-010: Insufficient argument validation in compat code|
-----BEGIN PGP SIGNED MESSAGE-----
NetBSD Security Advisory 2004-010
Topic: Insufficient argument validation in compat code
Version: NetBSD-current: source prior to Oct 27, 2004
NetBSD 2.0: not affected
NetBSD 1.6.2: affected
NetBSD 1.6.1: affected
NetBSD 1.6: affected
NetBSD 1.5.3: affected
NetBSD 1.5.2: affected
NetBSD 1.5.1: affected
NetBSD 1.5: affected
Severity: Local Denial of Service
possible Local Privilege Escalation
Fixed: NetBSD-current: Oct 28, 2004
NetBSD-2.0 branch: Nov 13, 2004 (2.0 includes the fix)
NetBSD-1.6 branch: Dec 17, 2004 (1.6.3 will include the fix)
Kernel syscall implementations must perform appropriate sanity checks on
data passed from userland. The native system calls perform appropriate
Some of the functions in /usr/src/sys/compat/* which implement execution
of foreign binaries (such as Linux, FreeBSD, IRIX, OSF1, SVR4, HPUX, and
ULTRIX) used argument data in unsafe ways prior to calling the kernel
This issue was reported by Evgeny Demidov.
The compat subsystem, in /usr/src/sys/compat/*, allows NetBSD users to
run binaries compiled for other operating systems which run on the same
CPU architecture as the NetBSD host.
Typically, the foreign OS supports a set of system calls which are very
similar to NetBSD's. Native instructions do not need to be translated,
but calls to the operating system do.
A binary's native OS is determined at exec() time. The kernel maps the
syscall table for the native OS so that each syscall is delivered to a
foreign OS -> NetBSD translation function, if needed.
These translation functions reorder arguments, reformat them, perform
mapping of constants (such as signal(3) IDs) and call the appropriate
native NetBSD system call to service the application's needs.
Some of the translation functions performed unsafe operations using the
syscall arguments, and were exploitable to cause kernel traps. Some of
the flaws may be exploitable and result in privilege escalation.
All of these attacks require local access to the system. A system with
only trusted user accounts is not immediately at risk.
A system running a custom kernel with all 'options COMPAT_' commented
out is not at risk.
See also Evgeny Demidov's advisory:
Solutions and Workarounds
The NetBSD 2.0 release already includes the fixes for this
Since the NetBSD-1-5 branch has reached End of Life, updating to
NetBSD-1-6 or NetBSD-2-0 is recommended.
netbsd-1-6, netbsd-2-0 (pre-release), netbsd-current:
*** Patching from sources:
The fix for this issue is contained in changes to several files, all
within the subdirectory:
The following instructions describe how to upgrade your kernel
binaries by updating your source tree and rebuilding and installing a
new version of the kernel. In these instructions, replace:
BRANCH with the appropriate CVS branch (netbsd-1-6,
ARCH with your architecture (from uname -m), and
KERNCONF with the name of your kernel configuration file.
To update from CVS, re-build and re-install the kernel:
# cd src
# cvs update -d -P -r BRANCH sys/compat
# cd sys/arch/ARCH/conf
# config KERNCONF
# cd ../compile/KERNCONF
# make depend; make
# mv /netbsd /netbsd.old
# cp netbsd /
# shutdown -fr now
Evgeny Demidov for notification, review of patches, and considerable patience.
Christos Zoulas, David Maxwell, and Simon Burge for patches and review.
2004-12-16 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 2004, The NetBSD Foundation, Inc. All Rights Reserved.
Redistribution permitted only in full, unmodified form.
$NetBSD: NetBSD-SA2004-010.txt,v 1.3 2004/12/16 16:12:27 david Exp $
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)
-----END PGP SIGNATURE-----
Go to the Top of This SecurityTracker Archive Page