Commit Graph

262938 Commits

Author SHA1 Message Date
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
mrg d482d53137 put a bunch of the kvm_read + warn on failure code into a macro that
describes more about what failed.  now errors tell you which actual
variable was being requested instead of simply saying "not yours".

tested on amd64 as working.  written for arm64 testing.
2018-11-06 04:07:22 +00:00
mrg f5f53dd6ab add support to detect the 3 vmware GPT partition types:
- VMKcore (dump partition)
- VMFS
- VMware reserved

this enables vmkcore partitions for netbsd swap or dump, as well
as naming all of them.
2018-11-06 04:04:33 +00:00
manu 0f1e9886f4 Fix use after RECLAIM in PUFFS filesystems
From hannken@

When puffs_cookie2vnode() misses an entry and vrele() it operations
puffs_vnop_reclaim() and puffs_vnop_fsync() get called with a VNON
vnode.

Do not notify the server in this case as the cookie is stale.
2018-11-06 02:39:49 +00:00
skrll eeb96914b4 Match the right MACHINE_ARCHes for GENERIC. 2018-11-05 21:34:33 +00:00
martin 7a39103985 Get rid of hard coded disk names and use sysctl hw.disknames
instead.
2018-11-05 19:45:56 +00:00
mlelstv 8e369ccc39 When refactoring interface drivers after netbsd-4, the SIOCINITIFADDR
ioctl was passed through ifioctl_common, because the case falls through
to the SIOCSIFFLAGS case. The common handler however doesn't implement
SIOCINITIFADDR, so an attempt to configure plip always failed with ENOTTY.
2018-11-05 18:37:18 +00:00
maya 79176afac1 Fix typo s/fron/from/
From dfive on freenode, thanks!
2018-11-05 17:44:09 +00:00
martin b57ba1ec69 For "unknown" sets (should only happen for pkgsrc.tgz), always use
.tgz suffix.
2018-11-05 17:04:03 +00:00
jmcneill fb26152160 ICC_PMR_EL1 has different encoding than IPRIORITYR. Not 100% sure that this is correct yet, but it works with both RK3399 and QEMU. 2018-11-05 11:50:15 +00:00
martin f4ed83519c Revert previous - local merge mishap 2018-11-05 10:27:06 +00:00
wiz 4736bd2c39 Sort options. 2018-11-05 09:22:30 +00:00
wiz b572c9cad3 Fix xref. 2018-11-05 09:18:55 +00:00
mrg 13795cc727 regenerate everything for GCC 6.5.
sh3eb and sh3el had a problem wtih libstdc++ i had to work around for now.
2018-11-05 08:46:31 +00:00
mrg 52c8e45302 GCC 6.5 ios_failure.cc needs to be compiled with cxx mode. 2018-11-05 08:45:32 +00:00
martin 4a0babdb00 Make it compilable with gcc 2018-11-05 08:34:20 +00:00
skrll a5ecb67bf4 Merge in VIRT now that qemu in pkgsrc can support it (missed in previous
commit)
2018-11-05 07:42:56 +00:00
skrll 4480f9e142 Merge in VIRT now that qemu in pkgsrc can support it 2018-11-05 07:41:46 +00:00
msaitoh 755dd63262 Decode Boot Graghics Resource Table (BGRT). 2018-11-05 07:39:57 +00:00
maya 81e6878869 Suggest to remove lfs_ stubs on a major bump.
they're deprecated, ioctl is used instead.
2018-11-05 04:08:39 +00:00
msaitoh 0ceebb2878 Decode PCI Enhanced Allocation. 2018-11-05 03:51:31 +00:00
manu 031ff5c667 Add missing mutex pn->pn_sizemtx lock in puffs_vnop_open()
puffs_vnop_open() calls flushvncache(), which calls dosetattr()
if pn->pn_stat has PNODE_METACACHE_MASK. In that case, the lock
on pn->pn_sizemtx is mandatory and asserted.
2018-11-05 02:28:32 +00:00
mrg 19db227738 initialise the kvm errbuf so that if an error occurs, but the
internal _kvm_*err() functions aren't called, stack garbage is
not reported as an error string.

call _kvm_err() if _kvm_kvatop() fails.  now the above is not
triggered anymore :-)
2018-11-05 00:43:30 +00:00
skrll ec787da840 Only add GENERIC to earmv6 and earmv7 builds 2018-11-04 21:41:12 +00:00
roy 9adaa956c5 syslogd: allow the reporting of buffer overflows to be disabled.
This generally isn't a good thing, nothing should be discard silently.
However, for systems that don't want big syslogd buffers or are too slow
to log effectively this reporting can now be disabled.
2018-11-04 20:45:21 +00:00
roy 0402a70e1e syslogd: allow the receiving buffer size to be set.
This allows the admin to try and avoid buffer overflow when a log of
logging appears in bursts.
2018-11-04 20:23:08 +00:00
palle d3020a7e64 Ensure that the 64-bit condition codes are used instead of the 32-bit condition codes. ok martin@ 2018-11-04 20:02:07 +00:00
christos 2d24b2e817 - Introduce a new SO_RERROR socket option to explicitly turn on
receive overflow errors re-instating the default behavior to
  silently ignore them as before 2018-03-19.
- Introduce a new kern.sooptions sysctl to control the default
  behavior of socket options. Setting this to 0x4000 (SO_RERROR),
  turns on receive overflow error reporting for all sockets.
- Change dhcpcd to turn on SO_RERROR on all its sockets.

As discussed in tech-net.
2018-11-04 16:30:28 +00:00
mlelstv d760c69bf1 PMAP_MAP_POOLPAGE must not fail. Trigger assertion here instead of
panic later from failing PR_WAITOK memory allocations.
2018-11-04 13:48:27 +00:00
maxv 8f30df5465 Add tprof in MAKEDEV.tmpl, and regen MAKEDEV.8. 2018-11-04 12:48:01 +00:00
mlelstv 5fdff78694 Fix error path in ip6 source address selection.
in6_selectsrc previously returned a pointer to an ipv6 address,
the pointer was NULL in case of an error and is checked later
instead of the also returned error code. When in6_selectsrc was
changed to store the address into a buffer, the error code
was still ignored, but the buffer pointer was never set to NULL.

As a result send() to an ipv6 address on a system that isn't
configured for ipv6 no longer returns the expected EADDRAVAIL
but fails later in ip6_output with EOPNOTSUPP when trying to
send from an unspecified address. The wrong error code caused
BIND to log the unexpected errors.
2018-11-04 08:48:01 +00:00
mrg d64c77df5f merge GCC 6.5. needs mknative as some new files appeared. 2018-11-04 00:38:12 +00:00
mrg d79abf0858 import GCC 6.5.0. this is largely a maint release with no
particularly features listed here:

   http://gcc.gnu.org/gcc-6/changes.html

this fixes over 250 PRs in the GCC bugzilla:

   https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=6.5
2018-11-04 00:12:20 +00:00
sevan 5c3002f0a7 Note the date Larry Levan passed away https://en.wikipedia.org/wiki/Larry_Levan 2018-11-03 22:04:30 +00:00
christos 837ff2531a make this compile again (rv was uninitialized) 2018-11-03 21:39:10 +00:00
sevan 017d75399e Let's house this up a bit.
Add The Mix Collection, mixed by Sasha & John Digweed.
https://en.wikipedia.org/wiki/Renaissance:_The_Mix_Collection
2018-11-03 21:34:35 +00:00
martin eb0dcb1bc7 Remove "usage" translations - they never could be displayed as we only select
the language later.
Extend usage display a bit and sync with reality.
2018-11-03 18:30:00 +00:00
jmcneill a3f1ad63e9 Fix build 2018-11-03 17:26:41 +00:00
christos fab43db2cd Deduplicate debug printing code. 2018-11-03 15:20:03 +00:00
skrll ea0da87b62 Less is more 2018-11-03 15:02:32 +00:00
martin 9277c3f45d Use PRIx64 printf format to make the 32bit version compile. 2018-11-03 14:56:36 +00:00
jmcneill 760c661c2f Match _PRT by segment and bus 2018-11-03 12:03:05 +00:00
wiz 233a76a940 Use more appropriate macros. Make a sentence easier to read. 2018-11-03 10:51:14 +00:00
maxv 4d04f81af5 Remove VA_SIGN_POS from the computation of the indexes, it is not needed. 2018-11-03 08:27:16 +00:00
jdolecek 13a160451f fix ahci_detach() to count the ports propertly (same as attach), to avoid
triggerring panic when disks are plugged to non-adjacent ports - this should
fix panic reported by Masanobu SAITOH on current-users

also fix different miscounting of ports in ahci_setup_ports() and
ahci_reprobe_drives()
2018-11-02 21:27:30 +00:00
macallan 1cee247332 add jbusi2c 2018-11-02 19:57:32 +00:00
jmcneill 03660f55df Do not ignore non-zero segment numbers in MCFG if __HAVE_PCI_GET_SEGMENT
is defined.
2018-11-02 19:51:08 +00:00
aymeric 09f9468abf Adapt secondary CPU bootstrapping to the new generic startup code. 2018-11-02 18:13:11 +00:00
aymeric 3b2af45d20 Make early console work. 2018-11-02 18:11:24 +00:00
aymeric aeb37cd257 . fix important typo which prevented enabling the SCU
. invalidate all cache tags of the SCU
2018-11-02 18:09:17 +00:00