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

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

                               ESB-2014.1545
                 Memory leak in the setsockopt system call
                             10 September 2014

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

        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-SA2014-012.txt.asc

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

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

		NetBSD Security Advisory 2014-012
		=================================

Topic:		Memory leak in the setsockopt system call


Version:	NetBSD-current:		source prior to Sat, Aug 16th 2014
		NetBSD 6.1 - 6.1.4:	affected
		NetBSD 6.0 - 6.0.5:	affected
		NetBSD 5.1 - 5.1.4:	affected
		NetBSD 5.2 - 5.2.2:	affected

Severity:	Local DoS

Fixed:		NetBSD-current:		Sat, Aug 16th 2014
		NetBSD-7 branch:	Sun, Aug 24th 2014
		NetBSD-6-0 branch:	Wed, Aug 27th 2014
		NetBSD-6-1 branch:	Wed, Aug 27th 2014
		NetBSD-6 branch:	Wed, Aug 27th 2014
		NetBSD-5.2 branch:	Wed, Aug 27th 2014
		NetBSD-5.1 branch:	Wed, Aug 27th 2014
		NetBSD-5 branch:	Wed, Aug 27th 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
========

A memory leak in the kernel could allow a local user to use up kernel
memory via repeated calls to the setsockopt system call, and thus to
freeze - or eventually panic - the system.


Technical Details
=================

When calling the setsockopt system call on an ipv6 socket with specific
arguments, a kernel buffer allocated to temporarily hold the socket
option data was not freed. Performing such a call in a loop would cause
the kernel to run out of memory and eventually panic.


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-7  netbsd-6  netbsd-6-1  netbsd-6-0
 ----  ----   --------  --------  ----------  ----------
 sys/netinet6/ip6_output.c
       1.158  1.157.2.1 1.145.2.1 1.145.8.1   1.145.6.1

 FILE  netbsd-5     netbsd-5-2     netbsd-5-1
 ----  --------     ----------     ----------
 sys/netinet6/ip6_output.c
       1.135.2.2    1.135.2.1.10.1 1.135.2.1.6.1

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

	# cd src
	# cvs update -d -P -r VERSION sys/netinet6/ip6_output.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 developing a code scanner which detected
the issue, and Ryota Ozaki for helping in developing a fix.


Revision History
================

	2014-09-08	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-SA2014-012.txt.asc

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


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

$NetBSD: NetBSD-SA2014-012.txt,v 1.1 2014/09/08 21:18:53 tonnerre Exp $

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

iQIcBAEBAgAGBQJUDh1JAAoJEAZJc6xMSnBuHwUP/3OPLYDozc7WuD+zFjhQaSzr
82ClbsCHvjTz+DdJ/jOXsQLK9GQI61jfqWxdB8uwUl5S+bel/Tcz/DUgtFdhOxT0
+xQ2AwgNnkMz4fnfobdVnUT6GSa+U4UJPjVytTqstTMdJLik8EawJookLL7hAFdc
l7usjjWkM0Gemzu6js1RGPFynvyFkSYBTXJGr5pJQbnpZkC0HtKqe/svquJYFe3a
TxddHAOMkxfNSrf0Wn8vBWeaTQ7Vc70ZJ/ZuxiczZsE/5Voq+ois73u0uAknCCu+
6lk2Tm3OmkK0mE25Q4iXRtPw0ogOmRa5RfyzYSWLvQ5cD5S0GrqQYrYAFAdHxaGV
LUSP4FmWTKYi/JOjTlgUKjFpysQANbY6o6NTCJeKnNfkcZBQZpe3xIC74mQaSGgv
fAhZ7s//ZY+jeusl/GAbA00rQLG3BPFXjSFyfL8NW//sWsZqd6YXV51YLJMTIVVm
Up2j7EUCszWKQWqIQjRtnl09ZaWBdr3i+3tpOa78elg5v1zuCFohQK0uB3v+klEU
xSsuvgwqzVnVjBniG3NNk+RSnaaTE8JGwgtAo8wGdjpLNkye6xQEzZW/3F7S9fXW
qX+Rm4aXspf9hINChCjOSzs/576ffmpsypE8PvDYPgbV6EjRC2pO4wq3IbuZGI4R
C7h9rpPfO6GxW3oKjMOb
=RKxi
- -----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

iQIVAwUBVA+u3RLndAQH1ShLAQINog/9EzpgWmflmcXvi8mXiVYYhWXYOloYsTFj
4I5hQV3f8FrzClWJO1EMhR5GOOZzHaMkrLLxGamC6fG45AKiBPDraK2wBJlPDR0J
cWD8MksaruJvU8mNSWmH1pyeMH9BY390h6qIaPKO6lxtJsirBohAOfmAQ5XTAUcy
FAph2GJJIPxrHlrNpS/K1ZbW9c/mNdIS6s7hacJrEvladhpJRnT5tA3XfCY83aZw
nKUFMfrAdjJUNS2S+orY/55HTLZyLT84SiCu6yNiPx2EAhTiD7P6NrDVytqzZVFD
H5ZwG5P9u6Xs0oftcqBXB9bTOMcshNRX0KH1G9gto7miAzHPFcsT9lZnlRwtRseq
E7mSgajWQ0/8ZdZgjdYEDLbrGeeer0GBVnKOl0YoBdXk2fmM6HAXMXYyrpcwF3pa
sY+TR0kIiq2RX+AuhTQLJ2QSeVj9TyXrYz+x0UmT9ZHr4qMLwVjUcbVJfUgch99i
sjfP/2gO7NJYnIbK1PS4dCjrnu8IwW6qg+8I6SYNk8X+Y9+WaGX87JPbwwP+rwfa
wpZV5DUuEB7v5O0WnU6Jt2TQNONvZ2++9auJOTSTL84novpj009JpNJxHF/XzB1F
S6gxbTmIZnBIDYBKIAy6dDNNp7vHBM9RGjNXcONeSwNfcFbD3WLC8EPHpUAhZIzF
cBAx7Rd277g=
=iPKW
-----END PGP SIGNATURE-----