[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
NetBSD Security Advisory 2018-001: Several vulnerabilities in context handling
-----BEGIN PGP SIGNED MESSAGE-----
NetBSD Security Advisory 2018-001
Topic: Several vulnerabilities in context handling
Version: NetBSD-current: source prior to Sat, Sep 2nd 2017
NetBSD 7.1: affected
NetBSD 7.0 - 7.0.2: affected
NetBSD 6.1 - 6.1.4: affected
NetBSD 6.0 - 6.0.5: affected
Severity: Privilege escalation / Local DoS
Fixed: NetBSD-current: Sat, Sep 2nd 2017
NetBSD-7-1 branch: Sun, Oct 1st 2017
NetBSD-7-0 branch: Sun, Oct 1st 2017
NetBSD-7 branch: Sun, Oct 1st 2017
NetBSD-6-1 branch: Fri, Oct 13th 2017
NetBSD-6-0 branch: Fri, Oct 13th 2017
NetBSD-6 branch: Fri, Oct 13th 2017
Teeny versions released later than the fix date will contain the fix.
Please note that NetBSD releases prior to 6.0 are no longer supported.
It is recommended that all users upgrade to a supported release.
Several issues were discovered in several ports of NetBSD:
1) sparc64: A missing mask in a syscall could allow userland to control a few
bits from a privileged register, allowing privilege escalations.
2) amd64: A subtle mistake in compat_linux32 could allow userland to generate
a particular fault in kernel mode, which caused the kernel to get confused
and re-enter itself in kernel mode but with the userland Thread-Local
Storage. This allowed privilege escalations.
3) i386: An instruction in the #UD exception handler was implicitly using the
userland %ds register without sanitizing it. This allowed at least local
1) A mistake in a syscall allowed an unprivileged user process to set
privileged bits, such as PSTATE_PRIV, in the %pstate register. Upon return
to userland the process would then be granted kernel privileges on the
2) The handling of the GDT on amd64 creates a condition where a page fault
can be generated if a segment register is reloaded with a "high" selector,
located near the end of the GDT. An incorrect check in a linux32 syscall
allowed unprivileged user processes to have the kernel page fault in such
a condition. However, the kernel does not correctly handle such exceptions:
it re-enters itself but does not switch to the kernel TLS, and instead uses
userland's. Userland therefore had a way to control a generic kernel
pointer, which allowed for full privilege escalation.
3) The #UD exception handler was implicitly using the %ds register, before it
actually initialized it to the kernel value. This allowed userland to crash
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 summarize 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-7-0 netbsd-7-1
---- ---- -------- ---------- ----------
1.24 184.108.40.206 220.127.116.11 18.104.22.168
1.39 22.214.171.124 126.96.36.199 188.8.131.52
1.12 184.108.40.206 220.127.116.11 18.104.22.168
FILE netbsd-6 netbsd-6-0 netbsd-6-1
---- -------- ---------- ----------
22.214.171.124 126.96.36.199 188.8.131.52
184.108.40.206 220.127.116.11 18.104.22.168
22.214.171.124 126.96.36.199 188.8.131.52
Note: in NetBSD 6, the fix for 3) is in a different file.
To update from CVS, re-build, and re-install the kernel:
# cd src
# cvs update -d -P -r VERSION sys/arch/sparc64/sparc64/compat_13_machdep.c
# cvs update -d -P -r VERSION sys/compat/linux32/arch/amd64/linux32_machdep.c
# cvs update -d -P -r VERSION sys/arch/i386/i386/i386_trap.S
# cvs update -d -P -r VERSION sys/arch/i386/i386/vector.S
# ./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:
Maxime Villard for finding and fixing the issues.
2018-01-02 Initial release
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
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/ .
Copyright 2018, The NetBSD Foundation, Inc. All Rights Reserved.
Redistribution permitted only in full, unmodified form.
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----
Main Index |
Thread Index |