259690 Commits

Author SHA1 Message Date
christos
c85e5e1ae4 PR/53365: Thomas Barabosch: memory leak in route6d
XXX: pullup 7, 8
2018-06-14 16:17:18 +00:00
maxv
edb6f1effc SpectreV4, backports in NetBSD-8, no XSAVEOPT 2018-06-14 14:48:59 +00:00
maxv
fbf420517e Add some code to support eager fpu switch, INTEL-SA-00145. We restore the
FPU state of the lwp right away during context switches. This guarantees
that when the CPU executes in userland, the FPU doesn't contain secrets.

Maybe we also need to clear the FPU in setregs(), not sure about this one.

Can be enabled/disabled via:

	machdep.fpu_eager = {0/1}

Not yet turned on automatically on affected CPUs (Intel Family 6).

More generally it would be good to turn it on automatically when XSAVEOPT
is supported, because in this case there is probably a non-negligible
performance gain; but we need to fix PR/52966.
2018-06-14 14:36:46 +00:00
jmcneill
33b9f57fe7 arm: Add support for QEMU ARM Virtual Machine ("virt"). 2018-06-14 10:57:42 +00:00
jmcneill
2417111f9f Add support for QEMU ARM Virtual Machine ("virt"). 2018-06-14 10:56:39 +00:00
jmcneill
2f78d473d8 Increase storage space for FDT data 2018-06-14 10:53:39 +00:00
uwe
4ac70e4d2b timespec_to_timespec50 - don't leak kernel memory in struct padding.
On 64-bit machines struct timespec50 has padding between 32-bit tv_sec
and long tv_nsec that is not affected by normal assignment.  Scrub it.
The result is most likely about to be passed to the user space by the
caller, so do it here to take care of them all.
2018-06-14 10:30:55 +00:00
kamil
079a9ba6ba Make the alignof() usage more portable in grep(1)
Remove NetBSD specific check and replace it with GCC extension __alignof__
that is available since GCC 2.x.

Requested by <kre>
2018-06-14 10:14:39 +00:00
msaitoh
24189a7035 Remove extra tabs. No functional change. 2018-06-14 09:29:55 +00:00
yamaguchi
c9cc6dd9e6 Update the error message in t_vlan (ENXIO => EINVAL)
ok ozaki-r@
2018-06-14 08:38:24 +00:00
yamaguchi
fac50df193 Fix to check whether the address has been added before delete
The list named ifv_mc_listhead saves multicast addresses that
are added through SIOCADDMULTI. Each nodes added to the list
are used for deleting the related address from a parent I/F
when remove the configuration of parent I/F.
In carp(4) and OpenBSD's vlan(4), the lists is used to check
a parameter of SIOCDELMULTI in addition to the use.
Based on them, the check is added to vlan(4)

ok ozaki-r@
2018-06-14 08:33:18 +00:00
ryo
9c9fdef1bf Widen shift to the LHS type.
same as aarch64/db_interface.c r1.4, PR/53338.
2018-06-14 08:27:10 +00:00
yamaguchi
9de5f4c04e Add test cases for multicast address handling of vlan(4)
ok ozaki-r@
2018-06-14 08:22:52 +00:00
yamaguchi
ebf325ec6a Add the lock to refer the list included in ethercom for safety
The lock is already held while adding and deleting
ok ozaki-r@
2018-06-14 08:06:07 +00:00
yamaguchi
e6eb667a4d Remove ETHER_LOOKUP_MULTI()
The macro has been replaced with a function.
ok ozaki-r@
2018-06-14 08:00:24 +00:00
yamaguchi
70db832747 Use ether_lookup_multi() instead of the macro
ok ozaki-r@
2018-06-14 07:54:57 +00:00
yamaguchi
6ab9099c9a Replace macros related to multicast address with inline functions
ok ozaki-r@
2018-06-14 07:44:31 +00:00
yamaguchi
15df08b929 Move macros related to multicast address into #ifdef _KERNEL
Those macros and structure are only used in the kernel.
reviewed by ozaki-r@n.o, thanks.
2018-06-14 07:39:16 +00:00
msaitoh
067b405cde s/regisrer/register/. No functional change. 2018-06-14 07:19:47 +00:00
msaitoh
8d2136076c The revision number of Yukon FE A2 is not 0x3 but 0x2. Same as other OSes. 2018-06-14 06:58:15 +00:00
msaitoh
b0e1e22279 Regen. 2018-06-14 04:00:13 +00:00
msaitoh
d897553535 Add Mobility Radeon HD 4300(0x9552) and Mobility Radeon HD 4500(0x9553)
from OpenBSD.
2018-06-14 03:59:53 +00:00
christos
3ae7054da4 remove notreached 2018-06-14 02:46:56 +00:00
christos
721572cdb2 return to caller instead of exit(2) 2018-06-14 02:44:16 +00:00
jdolecek
75f9f75f0c sort the models, and add several more variants; data found in OpenBSD eephy.c
this also makes makphy match model 88E3016, which adresses PR kern/53301
by Chris Humphries
2018-06-13 23:27:48 +00:00
jdolecek
d871fe233a regen 2018-06-13 23:25:41 +00:00
jdolecek
b7ee738b08 add E1000 with model id 0x0006, it exists according to OpenBSD
rename E1000 model 0x0000 to E1000_0 for consistency
2018-06-13 23:25:25 +00:00
jdolecek
1009e7c059 fix device name in printf when not matched 2018-06-13 20:18:54 +00:00
jdolecek
87182ff736 actually recognize the Yukon 2 variants up to SK_YUKON_OPTIMA2 as such 2018-06-13 20:17:03 +00:00
reinoud
7e24c78564 Split out error reporting and make it compile without SCSIVERBOSE 2018-06-13 19:59:14 +00:00
jdolecek
5f8aba250d sync and adapt with OpenBSD if_msk.c rev. 1.43-1.65 (modulo some
cosmetics, stuff we already had, or stuff which does not apply due
to different frameworks):

- Add support for fiber on 88E8021/22
- Avoid unnecessary resets.  This should make fiber 88E8021/22 work completely
- Only probe phy's at address 0; gets rid of bogus phy's on the
  Marvell Yukon 88E8036
- Remove an unused function msk_setfilt() which was copied from sk(4)
- Make msk(4) detachable
- Simplify the combination use of pci_mapreg_type()/pci_mapreg_map()
2018-06-13 19:37:23 +00:00
jdolecek
5cfbb15973 revert rev. 1.29 'Only tick mii if the phy had a status change', as neither
OpenBSD nor FreeBSD drivers have this conditional
2018-06-13 19:28:18 +00:00
kamil
2537a420e6 Detect properly overflow in expr(1) for 0 + INT 2018-06-13 17:35:15 +00:00
kamil
8317e0eadb Avoid Undefind Behavior in DEFAULT_ALIGNMENT in GNU grep(1)
Replace homegrown logic of calculating alignment with alignof, a C11 header
feature.

Add a check for NetBSD >= 8.0 just in case that someone will want to build
it on older NetBSD.

Issue detected with UBSan.
2018-06-13 17:32:29 +00:00
christos
970eaab5e8 revert previous MAKEOBJDIRPREFIX massaging 2018-06-13 16:03:10 +00:00
christos
15a5ffcf6f Create NETBSDOBJDIR to handle MAKEOBJDIRPREFIX, since that prepends the
prefix to the whole path.
Mention that we cannot handle MAKEOBJDIR
2018-06-13 15:46:26 +00:00
christos
448c6863b6 PR/53362: Thomas Barabosch: Use strlcpy() to prevent theoretical buffer
overflow.
2018-06-13 15:14:40 +00:00
jmcneill
590fdc6ff3 Revert "use len=0 for max length transfers" part of previous commit.
PR:	port-evbarm/53359
2018-06-13 11:17:02 +00:00
eadler
8ddc25ac24 libc: remove explicit cast NULL in atoi
There isn't any reason to cast NULL so just remove it. A similar change
was already made in DragonFly and FreeBSD (by me).

ok fly@
2018-06-13 09:38:32 +00:00
kamil
0d6563db8b Disable sanitizers for libm and librt
The sanitizers are designed to use pristine OS versions of these libraries,
install interceptors for public symbols in them and link with them in every
sanitized executable.

Having unmodified base libraries (c, m, rt, pthread) also makes the system
usable with programs linking with them and without sanitization, as there
are no fatal issues during the resolving of missing symbols.

The remaining libraries like libutil, libintl etc are prebuilt with
sanitization and all their users in the MKSANITIZER=yes distribution are
required to use the same sanitizer.

libc and libpthread are already marked with the NOSANITIZER flag.
2018-06-13 08:19:36 +00:00
ozaki-r
21f6c0a11a Don't wait on workqueue_wait if called from worker itself
Otherwise workqueue_wait never return in such a case.  This treatment
is the same as callout_halt.
2018-06-13 05:26:12 +00:00
maya
93c55cb558 Avoid declaring ulonglong_t.
Comment here already says it isn't necessary and will be removed.
Hasten the process for us and avoid the problematic typedef.

This is useful because u_longlong_t would otherwise need to be
provided by compat headers.
2018-06-13 04:21:21 +00:00
maya
c44313b349 Revert my previous config test inclusion for u_longlong_t.
Fixing this differently by avoiding the need for the definition.
It also caused a problem in OS X, as I neglected to include a correct header
2018-06-13 04:17:43 +00:00
ozaki-r
6cd7d12860 Refer ipsec(4) instead of fast_ipsec(4)
Because fast_ipsec(4) is retired and IPSEC is described in ipsec(4) now.
2018-06-13 03:34:13 +00:00
ozaki-r
ee6b84591c Retire fast_ipsec.4
We switched to Fast IPsec at NetBSD 6.0 and that's the IPsec implementation of
us now.  So we don't need to have a separate manual.  Merge fast_ipsec.4 into
ipsec.4 and remove fast_ipsec.4.
2018-06-13 03:28:36 +00:00
uwe
f946e9bde2 wsevent_copyout_events50 - don't leak garbage from the kernel stack.
On 64-bit machines struct timespec50 has padding between 32-bit tv_sec
and long tv_nsec that is not affected by normal assignment.  Scrub it
before we uiomove struct owscons_event.
2018-06-13 02:09:09 +00:00
sevan
fb516275cb macppc IPsec change from last week 2018-06-13 00:24:07 +00:00
christos
4fabbeb31b Move the typedefs before the header inclusions (except <features.h>) and
explain why.
2018-06-12 23:52:56 +00:00
jmcneill
8b313b2313 If setting rate on a clock with no set_rate function, and the desired rate
matches the current rate, don't return an error.
2018-06-12 23:08:37 +00:00
jdolecek
f4e29d9a9f move SK_HASH_BITS to if_skreg.h and reuse in if_msk.c (from OpenBSD) 2018-06-12 21:36:34 +00:00