Subject: NetBSD Security Advisory 2007-001: Integer overflow in ktruser()
To: None <netbsd-announce@NetBSD.org>
From: NetBSD Security-Officer <security-officer@netbsd.org>
List: netbsd-announce
Date: 03/08/2007 20:01:43
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


		 NetBSD Security Advisory 2007-001
		 =================================

Topic:		Integer overflow in ktruser()

Version:	NetBSD-current:	source prior to October 22, 2006
		NetBSD 4.0_BETA2:	not affected
		NetBSD 3.1:		not affected
		NetBSD 3.0.2:		not affected
		NetBSD 3.0.1:		affected
		NetBSD 3.0:		affected
		NetBSD 2.1:		affected
		NetBSD 2.0.*:		affected
		NetBSD 2.0:		affected

Severity:	Local denial of service, Local root compromise

Fixed:		NetBSD-current:		October 22, 2006
		NetBSD-3-0 branch:	October 24, 2006
		NetBSD-3 branch:	October 24, 2006
		NetBSD-2-1 branch:	February 9, 2007	
		NetBSD-2-0 branch:	February 9, 2007
		NetBSD-2 branch:	February 9, 2007


Abstract
========

Due to insufficient length checking in ktruser() as used by FreeBSD and
Darwin compatibility code, it is possible for a user to cause an integer 
overflow, resulting in a local denial of service and potentially 
local root compromise.

This vulnerability has been assigned CVE reference CVE-2007-1273.


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

Kernels with FreeBSD and/or Darwin binary emulation are affected, including 
the default GENERIC kernel install.  Users of affected NetBSD versions are 
highly recommended to upgrade their kernel.

Only kernels compiled with the following options are vulnerable to this issue:

	options COMPAT_FREEBSD
	options COMPAT_DARWIN

As a temporary workaround recompile the kernel with the above options
commented out.

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 sys/kern/kern_ktrace.c \
		sys/sys/ktrace.h \
		sys/compat/freebsd/freebsd_misc.c \
		sys/compat/darwin/darwin_iohidsystem.c \
		sys/compat/darwin/darwin_ktrace.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
=========

Christer Oberg of BitSec discovered and reported this issue.
Christos Zoulas fixed the code.


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

	2007-03-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 
  ftp://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2007-001.txt.asc

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


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

$NetBSD: NetBSD-SA2007-001.txt,v 1.1 2007/03/05 23:33:13 adrianp Exp $

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)

iQCVAwUBRe1o0T5Ru2/4N2IFAQJaagQAmsalluHlg7zDpkvxKPG7NLvgViEIFQIa
GLaaWqlGxsylcYe5Q5QLDUgZBBGazSJMMQULL3yt6l3LoNS2CqT3++BROpspUAKN
8PuImR/XP1frf3w0o8OKSe4i/cYDdt/3uvRydsx4+s3N8+2x6e5QcJ5o0SECDZTz
YON9ZG6ZSec=
=erhT
-----END PGP SIGNATURE-----