AUSCERT External Security Bulletin Redistribution

            ESB-2003.0656 -- NetBSD Security Advisory 2003-013
                    Kernel memory disclosure via ibcs2
                             19 September 2003


        AusCERT Security Bulletin Summary

Product:                kernel
Publisher:              NetBSD
Operating System:       NetBSD-current prior to August 7, 2002
                        NetBSD 1.6.1
                        NetBSD 1.6
Impact:                 Access Privileged Data
Access Required:        Existing Account

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


		 NetBSD Security Advisory 2003-013

Topic:		Kernel memory disclosure via ibcs2

Version:	NetBSD-current:	source prior to August 7, 2002
		NetBSD 1.6.1:	not affected
		NetBSD 1.6:	not affected
		NetBSD-1.5.3:	affected
		NetBSD-1.5.2:	affected
		NetBSD-1.5.1:	affected
		NetBSD-1.5:	affected


Fixed:		NetBSD-current:		August 7, 2002
		NetBSD-1.6 branch:	not affected
		NetBSD-1.5 branch:	August 28, 2002


The iBCS2 system call translator for statfs(2) erroneously used the
user-supplied length parameter when copying a kernel data structure
into userland.  If the length parameter were larger than required,
then instead of copying only the statfs-related data structure,
additional kernel memory would also be made available to the user.

Technical Details

If iBCS2 support were enabled, a malicious user could call the iBCS2
version of statfs(2) with an arbitrarily large length parameter,
causing the kernel to return a large portion of kernel memory.  Such
memory might contain sensitive information, such as portions of the
file cache or terminal buffers.  This information might be directly
useful, or it might be leveraged to obtain elevated privileges in some
way.  For example, a terminal buffer might include a user-entered

iBCS2 support is only present on i386/vax GENERIC kernel.

Solutions and Workarounds

If your kernel configuration file does not contain COMPAT_IBCS2, 
your system is not affected.

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

* NetBSD-current:

	Systems running NetBSD-current dated from before 2002-08-06
	should be upgraded to NetBSD-current dated 2002-08-07 or later.

	The following directories need to be updated from the
	netbsd-current CVS branch (aka HEAD):
	However, because the date of the point fix is way too old, we'd suggest
	you to update the whole kernel.  The following instruction is for
	updating the whole kernel.

	To update from CVS, re-build, and re-install the kernel and reboot:
		# cd src
		# cvs update -d -P sys

		# cd sys/ARCH/conf
		# config KERNELCONF
		# cd ../../compile/KERNELCONF
		# make depend; make

		# cp netbsd /
		# reboot

* NetBSD 1.6, 1.6.1:

	The binary distribution of NetBSD 1.6 and 1.6.1 are NOT vulnerable.

* NetBSD 1.5, 1.5.1, 1.5.2, 1.5.3:

	The binary distribution of NetBSD 1.5 to 1.5.3 are vulnerable.   

	Systems running NetBSD 1.5, 1.5.1, 1.5.2, or 1.5.3 sources dated
	from before 2003-08-27 should be upgraded from NetBSD 1.5.*
	sources dated 2003-08-28 or later.

	The following directories need to be updated from the
	netbsd-1-5 CVS branch:

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

		# cd src
		# cvs update -d -P -r netbsd-1-5 sys/compat/ibcs2/ibcs2_stat.c

		# cd sys/ARCH/conf
		# config KERNELCONF
		# cd ../../compile/KERNELCONF
		# make depend; make

		# cp netbsd /
		# reboot

	Alternatively, apply the following patch (with potential offset

	To patch, re-build and re-install re-install the kernel and reboot:

		# cd src/sys/compat/ibcs2
		# patch < /path/to/SA2003-013-ibcs2.patch

		# make cleandir dependall
		# make install

Thanks To

Some of the text are derived from FreeBSD security advisory

The problem in ibcs2_stat.c was pointed out by silvio@qualys.com.

Revision History

	2003-09-17	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 

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

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

$NetBSD: NetBSD-SA2003-013.txt,v 1.4 2003/09/17 02:47:19 david Exp $

Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org


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

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:


If you believe that your computer system has been compromised or attacked in 
any way, we encourage you to let us know by completing the secure National IT 
Incident Reporting Form at:


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.
Comment: http://www.auscert.org.au/render.html?it=1967