Go to file
ozaki-r 1266a13d1c Restore the length check of a sockaddr passed from userland at udp6_output
A sockaddr with invalid length could be passed to the network stack resulting in
a kernel panic like this:

	panic: sockaddr_copy: source too long, 28 < 128 bytes
	fatal breakpoint trap in supervisor mode
	trap type 1 code 0 rip 0xffffffff80216c35 cs 0x8 rflags 0x246 cr2 0x7f7ff7ef3000 ilevel 0x4 rsp 0xffff80003308b690
	curlwp 0xfffffe803e11ca40 pid 48.1 lowest kstack 0xffff8000330852c0
	Stopped in pid 48.1 (a.out) at  netbsd:breakpoint+0x5:  leave
	db{1}> bt
	breakpoint() at netbsd:breakpoint+0x5
	vpanic() at netbsd:vpanic+0x140
	panic() at netbsd:panic+0x3c
	sockaddr_copy() at netbsd:sockaddr_copy+0x95
	rtcache_setdst() at netbsd:rtcache_setdst+0x73
	rtcache_lookup2() at netbsd:rtcache_lookup2+0x56
	in6_selectroute() at netbsd:in6_selectroute+0x184
	in6_selectsrc() at netbsd:in6_selectsrc+0x119
	udp6_output() at netbsd:udp6_output+0x25e
	udp6_send_wrapper() at netbsd:udp6_send_wrapper+0x8a
	sosend() at netbsd:sosend+0x7bf
	do_sys_sendmsg_so() at netbsd:do_sys_sendmsg_so+0x28e
	do_sys_sendmsg() at netbsd:do_sys_sendmsg+0x89
	sys_sendto() at netbsd:sys_sendto+0x5c
	syscall() at netbsd:syscall+0x1ed
	--- syscall (number 133) ---
	7f7ff790173a:

Reported by Paul Ripke
2018-11-06 04:27:41 +00:00
bin Switch from using two printsignals() functions, one in trap.c 2018-10-28 18:26:52 +00:00
common add support to detect the 3 vmware GPT partition types: 2018-11-06 04:04:33 +00:00
compat don't build kernel grovelling tools as n64 on sgimips - we don't actually have 2018-09-20 02:51:21 +00:00
crypto Ooops - fix editor accident in previous 2018-10-15 12:45:52 +00:00
dist/pf Add a deprecation note in each of the PF man pages (instead of just pf.4), 2018-08-17 12:36:53 +00:00
distrib Use the GENERIC kernel where possible in armv7.img and remove the old 2018-11-01 11:05:24 +00:00
doc new tzcode 2018-10-27 22:32:54 +00:00
etc Match the right MACHINE_ARCHes for GENERIC. 2018-11-05 21:34:33 +00:00
external Fix typo s/fron/from/ 2018-11-05 17:44:09 +00:00
extsrc
games Advice from Bob Morris 2018-10-03 00:13:16 +00:00
include PR standards/53525: move getsubopt() to stdlib.h 2018-08-15 10:21:42 +00:00
lib Fix xref. 2018-11-05 09:18:55 +00:00
libexec sysctl(KERN_BOOTTIME) is a struct timespec, not struct timeval 2018-10-30 21:18:39 +00:00
regress Don't test call gates, they are not supported anymore. 2017-08-30 15:46:19 +00:00
rescue Remove the userland part of ISDN. The kernel part is untouched for now. 2018-09-23 07:24:19 +00:00
sbin put a bunch of the kvm_read + warn on failure code into a macro that 2018-11-06 04:07:22 +00:00
share - Introduce a new SO_RERROR socket option to explicitly turn on 2018-11-04 16:30:28 +00:00
sys Restore the length check of a sockaddr passed from userland at udp6_output 2018-11-06 04:27:41 +00:00
tests Handle ENOBUFS better and clean some whitespace. 2018-10-16 09:23:29 +00:00
tools Adjust whitespace to look more like assignment than comparison. NFC 2018-10-22 13:19:42 +00:00
usr.bin Note the date Larry Levan passed away https://en.wikipedia.org/wiki/Larry_Levan 2018-11-03 22:04:30 +00:00
usr.sbin Get rid of hard coded disk names and use sysctl hw.disknames 2018-11-05 19:45:56 +00:00
BUILDING regen 2018-07-29 20:53:41 +00:00
Makefile Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
Makefile.inc Re-add files that were accidentally deleted in my previous commit. 2018-05-02 07:34:44 +00:00
README.md Tidy up a bit. 2018-10-23 15:44:42 +00:00
UPDATING Note that we need to clean objdir for the OpenSSL update. 2018-09-24 13:18:35 +00:00
build.sh Add some aliases (from phone) 2018-08-09 08:30:29 +00:00

README.md

NetBSD

NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.

Building

You can cross-build NetBSD from most UNIX-like operating systems. To build for amd64 (x86_64), in the src directory:

./build.sh -U -u -j4 -m amd64 -O ~/obj release

Additional build information available in the BUILDING file.

Binaries

Testing

On a running NetBSD system:

cd /usr/tests; atf-run | atf-report

Troubleshooting

Latest sources

To fetch the main CVS repository:

cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P src

To work in the Git mirror, which is updated every few hours from CVS:

git clone https://github.com/NetBSD/src.git