-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2015.0706
              Two vulnerabilities in the compatibility layers
                               23 March 2015

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           kernel
Publisher:         NetBSD
Operating System:  NetBSD
Impact/Access:     Denial of Service -- Existing Account
Resolution:        Patch/Upgrade

Original Bulletin: 
   http://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2015-004.txt.asc

- --------------------------BEGIN INCLUDED TEXT--------------------

- -----BEGIN PGP SIGNED MESSAGE-----
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.


Abstract
========

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:

	/stand/${MACHINE_ARCH}/${KERNEL_VERSION}/modules/compat_${NAME}/compat_${NAME}.kmod

And running the following command to unload them:

	# modunload compat_${NAME}

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

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
 ----  ----  --------  ----------  ----------  --------  ----------  ----------
 src/sys/compat/freebsd/freebsd_sysctl.c
       1.17  1.15.22.1 1.15.36.1   1.15.28.1   1.14.10.1 1.14.20.1   1.14.16.1
 src/sys/compat/netbsd32/netbsd32_compat_30.c
       1.31  1.30.14.1 1.30.28.1   1.30.20.1   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
	# ./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:

   http://www.NetBSD.org/guide/en/chap-kernel.html


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 
  http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2015-004.txt.asc

Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/ .


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 $


- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJVCweDAAoJEAZJc6xMSnBudSoQAKzXCgzM755Y7TqPYit+cTB5
vjm9T/a9MHBQuDbGFhFRby8kyhUBVkgKZEa/XnW46Gq0ViLVBHzQrTxXy6nY2jHB
blGcQuP//0i3wef4KXIh4MLuuj2pLpJizChvZduTWO1o8S9JrEKK/e0cuK2EUbXe
Tqr3jd6C8JWyF2sRj1t4og+jma45+7rNwGUP5OlJ6G7Vk/RrW4YdOno9/j2ITDE3
gzysh5n4rqc4WpZbAXmjIsH5Jmq1NC/w5S1P/dnRkvawpMR3zEZetXukfDsfgKj+
FHX3kHkBYPTaAhhUK9TGT0Jptx8WNIJ5/oCcKe3rGFGqx65i3GCTtYasHhl5ZNpf
mYxqk06fjJN2kTrBCJgeo+e/NAfld96rs2nrdnTns+DybttuAalYfa9Z2+Nszub4
lNJKJBoEX2or8jiYR6dk1zqDDkC015g/Yzh6riRP/qVE1DD+xUC6N2IdjldG/od9
S8qUdea9YaWXNmjTTStOha26UT5G7Kv/VrKLEI3Ae8Hktnw/SQ5tivSAJvUiKl3W
ItpTIZwgdkYdKkMYAAxQ9fpbJYgKZNisvXWYOnlaek1XewFx86aVBEHBj3FsrGbO
7IAOiY0YxU61BZr5ZaALz6cD5IuLb7XNxCyLh5U4Z8AKaRlSyuH3OAmfRnfSXHMF
n/x29Cpg2RAC1KGD5Big
=SeEW
- -----END PGP SIGNATURE-----

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        http://www.auscert.org.au/render.html?cid=1980

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBVQ+Y8RLndAQH1ShLAQLGjxAAmY0CEVwVFldQxEgreQyb4Hnlph1OMw5L
k0QyzuDNXsJYnChiisziiBjnRAsSSByL4RTYGsVnY7nfs05XNKoCh/Y+RkFDF6D7
wSKNtZ11OJNJZGc6JLnIECuI0poufHqFEvUcdcHf0TwLkxkCLxqWSsdXb8BobBfQ
dsfudAi0X5LlKD3fYWRMyWLX/X/58lIPjzR5tGJaTqPTGMrz3XVd0kElhGzwINfX
FTYp6rkbFLwyd3ywuqWrPsZBgaVeS0KU4Vr9stY3UobvFJuuuRUVvXcpoEIkQi2M
oJ554el+0jsdRsyJtS8/H/4R7xunlduHb9BniAfPOhk/mmzy3HqcJ2BD6G0y4DkW
iyGlwiYlW/eWVv+6uR9vNcRQ4yBi7fAyoKMg4gL7JD8XEP+LhSGGANqures6MOyY
Hk1xPHCCWVWIdT6M2TNirDf41O3qoNdJl8qiu2GeS6C8+FeBrqybeS31Xm+L3HSM
KAQRnI8Zm619JIPkNwIt2Q0hkIjOyGc8S10e57vXCzGCzG5ps4CBHjtCOknigOx+
4B8TrSVPLg7Gn7fROP1bgKIFOmsRyB+0yWXMVSSDyoovLWaWDOTE/rZQufj37ocA
ymz8OPxgURll9W1YcyO/1jHDzmNdo1yUuVkWjNDGI87Dwxmy4+WNQPN5hhc3c6zn
DF521TBVSvA=
=wS97
-----END PGP SIGNATURE-----