Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

NetBSD Security Advisory 2015-004: Two vulnerabilities in the compatibility layers

Hash: SHA1

		NetBSD Security Advisory 2015-004

Topic:		Two vulnerabilities in the compatibility layers

Version:	NetBSD-current:		source prior to Fri, Oct 10th 2014
		NetBSD 6.1 - 6.1.5:	affected
		NetBSD 6.0 - 6.0.5:	affected
		NetBSD 5.1 - 5.1.5:	affected
		NetBSD 5.2 - 5.2.3:	affected

Severity:	Local DoS

Fixed:		NetBSD-current:		Fri, 10 Oct 2014
		NetBSD-6-0 branch:	Sun, 19 Oct 2014
		NetBSD-6-1 branch:	Sun, 19 Oct 2014
		NetBSD-6 branch:	Sun, 19 Oct 2014
		NetBSD-5-2 branch:	Mon, 27 Oct 2014
		NetBSD-5-1 branch:	Mon, 27 Oct 2014
		NetBSD-5 branch:	Mon, 27 Oct 2014

Teeny versions released later than the fix date will contain the fix.

Please note that NetBSD releases prior to 5.1 are no longer supported.
It is recommended that all users upgrade to a supported release.


Two compatibility layers are affected by two vulnerabilities:

	1) FreeBSD compatibility: Unsanitized userland pointer
	2) NetBSD 32-bit compatibility: Zero-sized memory allocation

Each of them allows a local user to crash the system.

COMPAT_FREEBSD is available on amd64, i386 and xen, and default-on
for the i386 GENERIC, XEN3_DOM0 and XEN3_DOMU kernels.

COMPAT_NETBSD32 is available and usually default-on on 64bit ports.

Technical Details

For more clarity the two layers affected will be referred to as
COMPAT_xx, where xx is the emulated system.

 1) Due to a missing input validation check in COMPAT_FREEBSD's sysctl
    system call, the kernel could read memory pointed to by an unsanitized
    userland pointer. Attempting to read an unmapped page will cause the
    kernel to crash.
 2) Due to a missing input validation check in COMPAT_NETBSD32's getdents
    system call, a user could cause the kernel to perform a zero-sized
    memory allocation, resulting in a crash.

Solutions and Workarounds

Disable the compability modules
You can achieve this with the modunload(8) tool. Please read the
appropriate manual page. For example, you can disable the FreeBSD module
by moving the kernel object files out of the way. These are located in:


And running the following command to unload them:

	# modunload compat_${NAME}

The modules have dependencies, so you need to unload them in the proper

You can also disable these modules by rebuilding your kernel without the
COMPAT_${NAME} options.

Note however that it is to be considered as a temporary workaround, and
you are strongly advised to fix your system from source.

Fix from source
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-6  netbsd-6-1  netbsd-6-0  netbsd-5  netbsd-5-2  netbsd-5-1
 ----  ----  --------  ----------  ----------  --------  ----------  ----------
       1.31   n/a       n/a         n/a

To update from CVS, re-build, and re-install the kernel:

	# cd src
	# cvs update -d -P -r VERSION sys/compat/freebsd/freebsd_sysctl.c
	# cvs update -d -P -r VERSION sys/compat/netbsd32/netbsd32_compat_30.c
	# ./ 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:

Thanks To

Thanks to Maxime Villard for finding and fixing these issues.

Revision History

	2015-03-17	Initial release

More Information

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 and .

Copyright 2015, The NetBSD Foundation, Inc.  All Rights Reserved.
Redistribution permitted only in full, unmodified form.

$NetBSD: NetBSD-SA2015-004.txt,v 1.1 2015/03/17 06:58:44 spz Exp $

Version: GnuPG v1


Home | Main Index | Thread Index | Old Index