-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 NetBSD Security Advisory 2010-010 ================================= Topic: Buffer Length Handling Errors in netsmb Version: NetBSD-current: source prior to July 13, 2010 NetBSD 5.0.2: affected NetBSD 5.0: affected NetBSD 4.0.1: affected NetBSD 4.0: affected Severity: Local Kernel Memory Exhaustion DoS Attack Fixed: NetBSD-current: July 13, 2010 NetBSD-5-0 branch July 17, 2010 NetBSD-5 branch July 17, 2010 NetBSD-4-0 branch July 23, 2010 NetBSD-4 branch July 23, 2010 Please note that NetBSD releases prior to 4.0 are no longer supported. It is recommended that all users upgrade to a supported release. Abstract ======== The netsmb filesystem kernel module was incorrectly checking buffer limits, thus enabling a regular user to cause the kernel to allocate large internal buffers to handle the request, which leads to memory exhaustion. Technical Details ================= The length parameters in ioctl SMBIOC_OPENSESSION were signed, and not checked for being negative. Solutions and Workarounds ========================= Kernels that do not contain 'file-system SMBFS' and 'pseudo-device nsmb' in their config are not affected. - - Don't mount netsmb volumes. - - Recompile and re-install the kernel. CVS branch file revision ------------- ---------------- ----------- HEAD src/sys/netsmb/mchain.h 1.9 HEAD src/sys/netsmb/smb_dev.h 1.7 HEAD src/sys/netsmb/smb_subr.c 1.35 HEAD src/sys/netsmb/smb_subr.h 1.19 HEAD src/sys/netsmb/subr_mchain.c 1.19 netbsd-5-0 src/sys/netsmb/mchain.h 1.7.58.1 netbsd-5-0 src/sys/netsmb/smb_dev.h 1.6.80.1 netbsd-5-0 src/sys/netsmb/smb_subr.c 1.32.12.1 netbsd-5-0 src/sys/netsmb/smb_subr.h 1.18.12.1 netbsd-5-0 src/sys/netsmb/subr_mchain.c 1.15.12.1 netbsd-5 src/sys/netsmb/mchain.h 1.7.52.1 netbsd-5 src/sys/netsmb/smb_dev.h 1.6.74.1 netbsd-5 src/sys/netsmb/smb_subr.c 1.32.6.1 netbsd-5 src/sys/netsmb/smb_subr.h 1.18.6.1 netbsd-5 src/sys/netsmb/subr_mchain.c 1.15.6.1 netbsd-4-0 src/sys/netsmb/mchain.h 1.6.34.1 netbsd-4-0 src/sys/netsmb/smb_dev.h 1.6.52.1 netbsd-4-0 src/sys/netsmb/smb_subr.c 1.29.8.1 netbsd-4-0 src/sys/netsmb/smb_subr.h 1.16.46.1 netbsd-4-0 src/sys/netsmb/subr_mchain.c 1.13.28.1 netbsd-4 src/sys/netsmb/mchain.h 1.6.24.1 netbsd-4 src/sys/netsmb/smb_dev.h 1.6.12.1 netbsd-4 src/sys/netsmb/smb_subr.c 1.29.2.1 netbsd-4 src/sys/netsmb/smb_subr.h 1.16.6.1 netbsd-4 src/sys/netsmb/subr_mchain.c 1.13.18.1 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 BRANCH with the appropriate CVS branch (from the above table) FILES with the file names for that branch (from the above table) 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 -r BRANCH FILES # ./build.sh tools 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 ========= Dan J. Rosenberg for discovering the bug and notifying us about it. Christos Zoulas for fixing the problem. Revision History ================ 2010-10-21 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 http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2010-010.txt.asc Information about NetBSD and NetBSD security can be found at http://www.NetBSD.org/ and http://www.NetBSD.org/Security/. Copyright 2010, The NetBSD Foundation, Inc. All Rights Reserved. Redistribution permitted only in full, unmodified form. $NetBSD: NetBSD-SA2010-010.txt,v 1.1 2010/10/21 09:06:11 tonnerre Exp $ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (NetBSD) iQIcBAEBAgAGBQJMwCWnAAoJEAZJc6xMSnBucecP/iszlMwovNd9054rBR4tc8lC Or3Q5SVI11oxM0DO9d12Bi/0I9zk9oZmwckFadm8M9rAZ7ijYXSoZJAEAvH+krP+ W46om/e0s+OhUMCjg51Ahf+w+84GtNHiFMpHyfoAKrOO+mFlIAlTVTQ/a/48uRIe VaokZGalgiJDgNqglrfnKX9OD/MCvXzAxOi7t3Y1TxTKPiWXn4lg18C/dAdx6SV7 6889SMqZNSF9pmy05qySAaEAasX5o9BQ7IW+WirUCAigX6ZNjTw555ZM0++ZvD1X eWCQtEy2mcknyKmMRvC1Xnc6WSi9JkSfpdHF6NnzB0UJltUjtpRHrTeS0syIsTgY Q1Jz+DoXgDdlJwooljqensaqw7rkgujrps9PaZCLco8jTufUb3AFms0R5VeWhkP3 li5maBZezjBU6W7SDEOcaIkfcdY5p/jKpUC3yoRrSMxjdzhq/aT9TBwmnqdKLrDu +E/guJFfe/SwjkZc9WK4GUbDVgpQtX10cA1kTNzaCO80+XGjNiqhv0COTFx9hleO sUXIHs68zOOt7rotgUEoqBY/cOyw2/h1+Ihgh6JsLgBUkuD1qcCsp0umXOclmoCT 4dgH7NJ2eXgoXvsS8HHRstgPOPB0XhUzxEzl5/Iv6Uc+COnlKfR3l2w10lUbIbaL jdg2XIlwzyzs7pBxxCPs =OA0n -----END PGP SIGNATURE-----