-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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

                               ESB-2020.0898
         NetBSD Security Advisory 2020-002: Specific ICMPv6 error
                    message packet can crash the system
                               12 March 2020

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

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

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

Original Bulletin: 
   https://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2020-002.txt.asc

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

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

		NetBSD Security Advisory 2020-002
		=================================

Topic:		Specific ICMPv6 error message packet can crash the system

Version:	NetBSD-current:		affected untill January 23, 2020
		NetBSD 9.0:		not affected
		NetBSD 8.1:		affected
		NetBSD 7.x:		not affected

Severity:	Remote packets can crash the machine

Fixed:		NetBSD-current:		January 23, 2020
		NetBSD-9 branch:	January 23, 2020
		NetBSD-8 branch:	January 23, 2020
		NetBSD-7 branch:	not affected

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

Abstract
========

Due to a mistake in IP-IP tunnel packet processing, a malicious ICMPv6
error message packet whose payload is an IP-IP tunnel packet
can cause incorrect resource freeing leading to a system crash.
This is a remote DoS, that affects all systems that have IPv6 enabled.

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

NetBSD-7 is not affected since it does not use the resource that
is erroneously being freed.

Solutions and Workarounds
=========================

1. Filter out ICMPv6 'packet too big'-type packets using NPF. Here's an
example npf.conf file, assuming wm0 is the interface to be protected:

$int_if = ifaddrs(wm0)
 
group default {
    block in final on $int_if family inet6 proto ipv6-icmp icmp-type 2 all
    pass in on $int_if all
    pass out on $int_if all
}

Note that this workaround disables reception of packet-too-big icmp6 messages
which are necessary for the host to perform pmtu discovery.
If a remote host is on a network with a smaller MTU, IPv6 communication may
not work properly.

2. Update the kernel to a fixed version and reboot.

To apply a fixed version from a releng build, fetch a fitting kern-GENERIC.tgz
from nyftp.netbsd.org and extract the fixed binaries:

cd /var/tmp
ftp https://nycdn.NetBSD.org/pub/NetBSD-daily/REL/latest/ARCH/binary/sets/kern-GENERIC.tgz
cd /
tar xzpf /var/tmp/kern-GENERIC.tgz

with the following replacements:
REL   = the release version you are using
ARCH  = your system's architecture

The following instructions describe how to upgrade your kernel by
updating your source tree and rebuilding and installing a new version.

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), 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 src/sys/netinet/ip_encap.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/docs/guide/en/chap-kernel.html

The patches can be obtained from NetBSD-current with the following
command:

cvs rdiff -u -r1.71 -r1.72 src/sys/netinet/ip_encap.c

Thanks To
=========

Yasuhiro Ohishi for pointing out the problem.
Kengo Nakahara for providing the fix.

More Information
================

Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at

	https://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2020-002.txt.asc

Information about NetBSD and NetBSD security can be found at

	https://www.NetBSD.org/
	https://www.NetBSD.org/Security/

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

$NetBSD: NetBSD-SA2020-002.txt.asc,v 1.3 2020/03/11 02:33:04 christos Exp $
- -----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJeaE2fAAoJEIkmHhf170n/3FsP/00Wnw3rg9ykFcVZMO0B86eK
VUWT1G3a+cDSAyUWlpXmNRTqIzsHBZYCjb+OMiI79Gwsa2IqED9QGiJRL5zaOzhk
3XhDzo3/ibIR2c+4F970At+t+C37EAVCbpQrQpIgFjM78M+Y9CiZXq2jvDqCzC/W
XKhZ8t9EvwUdygQ5lT1IJXZb/uHpbewhNTwcqEbzdlXtNoSFaPmixJODGF82nhSa
SW/AobdEv9GeHjNCBAtVpcvBTy4o/wbYxDmF5gH+5X6360abvOBRWCbTjjiL+ecK
uQA9rDd1CDNaR+g4tjs1TtEFFdg1DfYOwtXyrgpa4t/EF9X3HaOGqlXxGyzjn4fJ
SQbKvSYY4k/RFa7rQ7ACztuimjSswDvoGd0V1AmtkMflBXnUPsnN60DrueWjws0c
Bab+kKXfnwVrrMoSqqHH1uVCJHxjsIUbsqo/gJP9mDskg6t1lmIrne2eIWh+MJ9b
CPkas5i1vPRjj7+1w5vslQEaENPwN4gVAXtT45orRW5f0VNdFs79mvq9Xmqtd/xD
rIrQu19oOMIEdswVQurkwvTJ1F3ul+mOVhrfSw/QS/RX++2upQ+q5ZEWKym7+9TQ
MG+FFl410sob/jFIrExOIQU5YTdIdIs6XVAJzOgliirc221eAVnxOWo9qV03VqdW
+DlHwc4pXmWep7qW8jGX
=YhmF
- -----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:

        https://www.auscert.org.au/bulletins/

===========================================================================
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

iQIVAwUBXmnKF2aOgq3Tt24GAQg3Wg/9EQ1b1XBJhyyJQYBARl0rLBJXwSCs/e/8
u/lpcPmB3pMYHvooHFFXFAiJRVVWi3FqUG8Q5Tf9kyfIYnyUBhtgHDakW0SrhC1/
rkpDfLO0RPPFNewn4WP0cfIk8UyspW0kWSi00ul/E5V+ULNk3Y1Kul2rS4gIaOA6
pwC/gRIuCcl0CPbAh02fywNERTtgaJVT290sOoRbsq7CmXSkNMh7JjlDQaLXvERo
M/Y9TMmhqdqKUCz0PYA1DIU8ngjJEyW26nkJQdTE92dbRLnGg1ZUC7p7HZ07eQDC
eMzkItWp89zCi2cB+2d9XTZ49mLwvHxMIGrLcdgaj3PeAMrsErtAZnNtYFovIUrI
Bq2q7HdY7ZzZDFwrHJ4Bjh0pN/qbIyq3diPbfXL2PRawIKKVJgUckPW8/mB7paRV
WFnZJO1msJPsR6usx1HP3KqhXXZBk2gMsbaCUP0TSPAvoCxsex2f1APzxkyO4nI3
GmJPyq1X6paYBACkSpTBPxeWknDWinY68WWmmKqsSAE9VdVvaUafWcwvjNE1mxJY
P/v1Zf8UcLmRu5d2sIdod/suiGmM3m747qkO0xeGWJU9Y/XVlQgVhRbF7yNwjGDz
qgwaUYB9b+p7Z8ztwLy6yEMnAyW5Qn/hQ25e5WgfYc+2Opu1SjlkZG8HXvKR+xML
88KdLYbda9o=
=333v
-----END PGP SIGNATURE-----