-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NetBSD Security Advisory 2022-002 ================================= Topic: Coredump credential reference count leak Version: NetBSD-current: affected prior to 2022-09-10 NetBSD 9.*: affected NetBSD 8.*: affected Severity: Malicious user may read from opened file descriptors by other processes. Fixed: NetBSD-current: September 10, 2022 NetBSD-9 branch: September 10, 2022 NetBSD-8 branch: September 10, 2022 Please note that NetBSD releases prior to 8 are no longer supported. It is recommended that all users upgrade to a supported release. Abstract ======== The coredump handling code always leaks a reference to the dumped processes cred structure. An attacker may cause the reference count to overflow, leading to a use after free (UAF). Solutions and Workarounds ========================= Set the coredump resource limit to 0 to prevent coredumps in the system. To apply a fixed version from a releng build, fetch a fitting kern-GENERIC.tgz from nycdn.NetBSD.org and extract the fixed binaries: cd /var/tmp ftp https://nycdn.NetBSD.org/pub/NetBSD-daily/REL/BUILD/ARCH/binary/sets/kern-GENERIC.tgz cd / tar xzpf /var/tmp/kern-GENERIC.tgz with the following replacements: REL = the release version you are using BUILD = the source date of the build. 20220910 and later will fit 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 of the kernel. 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 sys/kern/kern_core.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: https://www.NetBSD.org/docs/guide/en/chap-kernel.html Thanks To ========= Chris J-D for discovering, analyzing the problem and proposing a fix. Revision History ================ 2022-10-02 Initial release 2022-10-08 Mention all branches affected More Information ================ Advisories may be updated as new information becomes available. The most recent version of this advisory (PGP signed) can be found at https://cdn.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2022-002.txt.asc Information about NetBSD and NetBSD security can be found at https://www.NetBSD.org/ https://www.NetBSD.org/support/security/ Copyright 2022, The NetBSD Foundation, Inc. All Rights Reserved. Redistribution permitted only in full, unmodified form. $Id: NetBSD-SA2022-002.txt,v 1.3 2022/10/08 13:28:21 christos Exp $ -----BEGIN PGP SIGNATURE----- iQJQBAEBCAA6FiEEJxEzJivzXLUNT1BGiSYeF/XvSf8FAmNBe0scHHNlY3VyaXR5 LW9mZmljZXJAbmV0YnNkLm9yZwAKCRCJJh4X9e9J/xY0EADLkCH83chrZuRwaNDW PVQLnMGHJgTF1zUmlglr8xAOcEGeVAEu8p6CZcYC/E2FSuOItMz4p0fg3gHSgBBu PqyGQ9xoeIqGf5HBIddt6K2KyHD0YPoVh/pKbUSUhcbxcWehiF9omZwYef8+KD3c ZXt3OWfTf90FgP6O/OAtEJvGGmjNo944sXrXHn25JaSgstAdEVJdjT2NPzpTSbmH 05tXuHuCS5AFyQ25MJWyqqPRYMkQHl9hnbbhj3ScDZkYYGSMMZtsms2MPg/9tWYe 5AFMfBi7VjyXcBW+4/heXY9kIhhaEMGdzX5zs2ZaNIggF4M+KSekB7BJkXC/kC7n dzD6ruDruUoFLimd+UpJxnhcVdG/EYfV74ToMTIRGcEvVIUz9+iW6mIIfivv+9Lv +JkyXeHCO2pVXlYppKZ53avWOQ3Wko6aoAus28gbpou/EICY5slc9iQNgdR98Jgn iHj7BT+Grv0T5kILdPpNh8lOKve8mE4IE9j/JDKDEgj7oVgLFFUY1/UHQKi+x2Sg cvfs5ebjwlrNPGUujZX2QKiNY/JQ8DkI1v0kI6npyVUK/k0Rg/+1n3tq98XEkn44 qGpFF/fcoBdjHZYCan8n2VyWDWhLZKZ4nfmhJUlVJcfssSjBXbpiqfcrnYzRsRGn vRUaZyaxKmgZJB4Prsv7Z9K9hw== =nRdy -----END PGP SIGNATURE-----