Security-Announce archive

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

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

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.


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 and extract the fixed binaries:

cd /var/tmp
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
	# ./ 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:

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

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

Information about NetBSD and NetBSD security can be found at

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 $


Home | Main Index | Thread Index | Old Index