Commit Graph

247527 Commits

Author SHA1 Message Date
Ed Maste
6ed1dc004a Tag NLS aliases with package=runtime
POSIX and en_US.US_ASCII are aliases (symlinks) to the C locale.  They were
not previously tagged with a pkgbase pacakge.  Add the tag so that they are
handled correctly on pkgbase-installed/updated systems.

Discussed with:	manu
2020-01-22 18:40:19 +00:00
Gleb Smirnoff
a3b0db5b0a Plug possible calls into ip6?_output() without network epoch from SCTP
bluntly adding epoch entrance into the macro that SCTP uses to call
ip6?_output().  This definitely will introduce several epoch recursions.

Reported by:	https://syzkaller.appspot.com/bug?id=79f03f574594a5be464997310896765c458ed80a
Reported by:	https://syzkaller.appspot.com/bug?id=07c6f52106cddbe356cc2b2f3664a1c51cc0dadf
2020-01-22 17:19:53 +00:00
Gleb Smirnoff
e617b21d2f Enter network epoch when calling in_pcbconnect() for IPv6 mapped to IPv4
UDP sockets.  This is miss from r356983.

Reported by:	https://syzkaller.appspot.com/bug?id=73c7a2e3f0783f9947459065e5c2f25fe8f82f54
2020-01-22 17:06:55 +00:00
Bjoern A. Zeeb
7754e281c0 Fix NOINET kernels after r356983.
All gotos to the label are within the #ifdef INET section, which leaves
us with an unused label.  Cover the label under #ifdef INET as well to
avoid the warning and compile time error.
2020-01-22 15:06:59 +00:00
Kyle Evans
156ebad647 Tag os-release symlink with package=runtime
This ensures it gets into pkgbase-(installed/updated) systems.
2020-01-22 14:07:27 +00:00
Alexander V. Chernikov
34a5582c47 Bring back redirect route expiration.
Redirect (and temporal) route expiration was broken a while ago.
This change brings route expiration back, with unified IPv4/IPv6 handling code.

It introduces net.inet.icmp.redirtimeout sysctl, allowing to set
 an expiration time for redirected routes. It defaults to 10 minutes,
 analogues with net.inet6.icmp6.redirtimeout.

Implementation uses separate file, route_temporal.c, as route.c is already
 bloated with tons of different functions.
Internally, expiration is implemented as an per-rnh callout scheduled when
 route with non-zero rt_expire time is added or rt_expire is changed.
 It does not add any overhead when no temporal routes are present.

Callout traverses entire routing tree under wlock, scheduling expired routes
 for deletion and calculating the next time it needs to be run. The rationale
 for such implemention is the following: typically workloads requiring large
 amount of routes have redirects turned off already, while the systems with
 small amount of routes will not inhibit large overhead during tree traversal.

This changes also fixes netstat -rn display of route expiration time, which
 has been broken since the conversion from kread() to sysctl.

Reviewed by:	bz
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D23075
2020-01-22 13:53:18 +00:00
Gleb Smirnoff
c1604fe4d2 Make in_pcbladdr() require network epoch entered by its callers. Together
with this widen network epoch coverage up to tcp_connect() and udp_connect().

Revisions from r356974 and up to this revision cover D23187.

Differential Revision:	https://reviews.freebsd.org/D23187
2020-01-22 06:10:41 +00:00
Gleb Smirnoff
e2636f0a78 Remove extraneous NET_EPOCH_ASSERT - the full function is covered. 2020-01-22 06:07:27 +00:00
Gleb Smirnoff
3fed74e90f Re-absorb tcp_detach() back into tcp_usr_detach() as the comment suggests.
Not a functional change.
2020-01-22 06:06:27 +00:00
Gleb Smirnoff
5fc8df3c49 Don't enter network epoch in tcp_usr_detach. A PCB removal doesn't
require that.
2020-01-22 06:04:56 +00:00
Gleb Smirnoff
5c722e2ad3 The network epoch changes in the TCP stack combined with old r286227,
actually make removal of a PCB not needing ipi_lock in any form.  The
ipi_list_lock is sufficient.
2020-01-22 06:03:45 +00:00
Gleb Smirnoff
7669c586da tcp_usr_attach() doesn't need network epoch. in_pcbfree() and
in_pcbdetach() perform all necessary synchronization themselves.
2020-01-22 06:01:26 +00:00
Gleb Smirnoff
6a2954a17d Relax locking requirements for in_pcballoc(). All pcbinfo fields
modified by this function are protected by the PCB list lock that is
acquired inside the function.

This could have been done even before epoch changes, after r286227.
2020-01-22 05:58:29 +00:00
Gleb Smirnoff
0f6385e705 Inline tcp_attach() into tcp_usr_attach(). Not a functional change. 2020-01-22 05:54:58 +00:00
Gleb Smirnoff
109eb549e1 Make tcp_output() require network epoch.
Enter the epoch before calling into tcp_output() from those
functions, that didn't do that before.

This eliminates a bunch of epoch recursions in TCP.
2020-01-22 05:53:16 +00:00
Gleb Smirnoff
b955545386 Make ip6_output() and ip_output() require network epoch.
All callers that before may called into these functions
without network epoch now must enter it.
2020-01-22 05:51:22 +00:00
Gleb Smirnoff
a7f12fce22 Remove struct callout_handle. Should have gone with r355732. 2020-01-22 05:47:59 +00:00
Gleb Smirnoff
c57b57da35 Remove comment that no longer describe reality. 2020-01-22 05:32:23 +00:00
Gleb Smirnoff
13e3c791fc In compatibility structure substitute 'struct callout_handle'
to 'struct callout *' pointer of the same size.
2020-01-22 05:31:37 +00:00
Gleb Smirnoff
0452a1f3ef Add documenting NET_EPOCH_ASSERT() to tcp_drop(). 2020-01-22 02:38:46 +00:00
Gleb Smirnoff
bab98355f9 Add some documenting NET_EPOCH_ASSERTs. 2020-01-22 02:37:47 +00:00
Gleb Smirnoff
f6a2a6b163 Unroll macro that is used just once. Not a functional change. 2020-01-22 02:35:39 +00:00
Gleb Smirnoff
1d11092814 Change argument order of epoch_call() to more natural, first function,
then its argument.

A miss from r356826.
2020-01-22 02:28:39 +00:00
Brandon Bergren
0a90eb9f2f [PowerPC] libc backwards compatibility shim for auxv change
As part of the FreeBSD powerpc* flag day (1300070), the auxv numbering was
changed to match every other platform.

See D20799 for more details on that change.

While the kernel and rtld were adapted, libc was not, so old dynamic
binaries broke for reasons other than the ABI change on powerpc64.

Since it's possible to support nearly everything regarding old binaries by
adding compatibility code to libc (as besides rtld, it is the main point
where auxv is digested), we might as well provide compatibility code.

The only unhandled case remaining should be "new format libraries that call
elf_aux_info() which are dynamically linked to by old-format binaries",
which should be quite rare.

Reviewed by:	jhibbits
Sponsored by:	Tag1 Consulting, Inc.
Differential Revision:	https://reviews.freebsd.org/D23096
2020-01-22 02:06:34 +00:00
Jung-uk Kim
a9e3baa562 Install man5 and man7 for OpenSSL.
Note config.5 and crypto.7 are not installed because we have conflicts.

Requested by:	phk
MFC after:	1 month
2020-01-22 01:15:57 +00:00
Hans Petter Selasky
540f67be4e Add new USB ID to uslcom(4).
Submitted by:	Oleg Sharoyko <osharoiko@gmail.com>
PR:		243494
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-01-21 22:28:16 +00:00
Kyle Evans
a1fa478b1c posix_spawn: mark error as volatile
In the case of an error, the RFSPAWN'd thread will write back to psa->error
with the correct exit code. Mark this as volatile as the return value is
being actively dorked up for erroneous exits on !x86.

This fixes the following tests, tested on aarch64 (only under qemu, at the
moment):

- posix_spawn/spawn_test:t_spawn_missing
- posix_spawn/spawn_test:t_spawn_nonexec
- posix_spawn/spawn_test:t_spawn_zero

Reported by:	mikael
MFC after:	3 days
2020-01-21 22:02:53 +00:00
Edward Tomasz Napierala
10f2d3f857 Revert r356948; breaks build somehow. 2020-01-21 20:32:49 +00:00
Cy Schubert
5a00480bb9 Fix build when WITHOUT_WPA_SUPPLICANT_EAPOL option used.
The build failure was discoved by Michael Dexter's recent Build Options
Survey run, at https://callfortesting.org/results/bos-2020-01-16/\
WITHOUT_WPA_SUPPLICANT_EAPOL-small.txt.

Reported by:	Michael Dexter <editor@callfortesting.org> via emaste
MFC after:	2 weeks
2020-01-21 20:21:52 +00:00
Edward Tomasz Napierala
c5f4e26e7d Make linux(4) handle MAP_32BIT.
This unbreaks Mono (mono-devel-4.6.2.7+dfsg-1ubuntu1 from Ubuntu Bionic);
previously would crash on "amd64_is_imm32" assert.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-01-21 19:19:02 +00:00
Mark Johnston
9ddf3d342b Add relocation handling required for -zifunc-noplt to work on arm64.
Static relocations for the immediate operand of a branch instruction
must be applied.

In a patch which implements LSE-based atomic(9) operations using ifuncs,
-zifunc-noplt reduces system CPU usage during a buildkernel by several
percent.

Also fix elf_reloc_internal() to return an error if symbol lookup fails.

Reviewed by:	andrew
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17392
2020-01-21 17:45:49 +00:00
Mark Johnston
f01fe060e6 Regen.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-01-21 17:28:36 +00:00
Mark Johnston
149afbf3ba Fix 64-bit syscall argument fetching in 32-bit Linux syscall handlers.
The Linux32 system call argument fetcher places each argument (passed in
registers in the Linux x86 system call convention) into an entry in the
generic system call args array.  Each member of this array is 8 bytes
wide, so this approach is broken for system calls that take off_t
arguments.

Fix the problem by splitting l_loff_t arguments in the 32-bit system
call descriptions, the same as we do for FreeBSD32.  Change entry points
to handle this using the PAIR32TO64 macro.

Move linux_ftruncate64() into compat/linux.

PR:		243155
Reported by:	Alex S <iwtcex@gmail.com>
Reviewed by:	kib (previous version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23210
2020-01-21 17:28:22 +00:00
Eugene Grosbein
4c6076088a libexec/rc/rc.d/ipfw: style fix after r356943
Also, make sure it does not break for systems without ipfw code loaded.

MFC after:	1 months
X-MFC-with:	356943
2020-01-21 17:16:02 +00:00
Eugene Grosbein
7d82194866 Correct "service ipfw status" for INET6-only systems.
MFC after:	1 month
2020-01-21 17:02:57 +00:00
Brooks Davis
b02706324a Correct a misleading indent.
This dates to before the beginning of our repo and was found clang 10.

MFC after:	3 days
Sponsored by:	DARPA
2020-01-21 16:31:08 +00:00
Konstantin Belousov
2ee49fac82 Add support for Hygon Dhyana Family 18h processor.
As a new x86 CPU vendor, Chengdu Haiguang IC Design Co., Ltd (Hygon)
is a joint venture between AMD and Haiguang Information Technology Co.,
Ltd., aims at providing x86 processors for China server market.

The first generation Hygon processor(Dhyana) shares most architecture
with AMD's family 17h, but with different CPU vendor ID("HygonGenuine")
and PCI vendor ID(0x1d94) and family series number 18h(Hygon negotiated
with AMD to confirm that only Hygon use family 18h).

To enable Hygon Dhyana support in FreeBSD, add new definitions
HYGON_VENDOR_ID("HygonGenuine") and X86_VENDOR_HYGON(0x1d94) to identify
Hygon Dhyana CPU.

Initialize the CPU features(topology, local APIC ext, MSI, TSC, hwpstate,
MCA, DEBUG_CTL, etc) for amd64 and i386 mode by sharing the code path of
AMD family 17h.

The changes have been applied on FreeBSD 13.0-CURRENT and tested
successfully on Hygon Dhyana processor.

References:
[1] Linux kernel patches for Hygon Dhyana, merged in 4.20:

https://git.kernel.org/tip/c9661c1e80b609cd038db7c908e061f0535804ef

[2] MSR and CPUID definition:

https://www.amd.com/system/files/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf

Submitted by:	Pu Wen <puwen@hygon.cn>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23163
2020-01-21 13:22:35 +00:00
Alexander V. Chernikov
16c2f24169 Document requirements for the 'struct route' variations.
MFC after:	2 weeks
2020-01-21 12:00:34 +00:00
Hans Petter Selasky
1f69a50940 Make sure the VNET is properly set when calling tcp_drop() from
the ktls taskqueue callback function.

A valid VNET is needed when updating statistics.

panic()
tcp_state_change()
tcp_drop()
ktls_reset_send_tag()
taskqueue_run_locked()
taskqueue_thread_loop()

Sponsored by:	Mellanox Technologies
2020-01-21 11:43:25 +00:00
Kyle Evans
2a466bc451 sysent.mk: split interpreter out of target command
The main objective here is to make it easy to identify what needs to change
in order to use a different sysent generator than the current Lua-based one,
which may be used to MFC some of the changes that have happened so we can
avoid parallel accidents in stable branches, for instance.

As a secondary objective, it's now feasible to override the generator on a
per-Makefile basis if needed, so that one could refactor their Makefile to
use this while pinning generation to the legacy makesyscalls.sh. I don't
anticipate any consistent need for such a thing, but it's low-effort to
achieve.
2020-01-21 05:01:11 +00:00
Jeff Roberson
5949b1ca8c Move readahead and dropbehind fault functionality into a helper routine for
clarity.

Reviewed by:	dougm, kib, markj
Differential Revision:	https://reviews.freebsd.org/D23282
2020-01-21 00:12:57 +00:00
Conrad Meyer
825a73c36f random.3: Some minor improvements to wording/clarity 2020-01-20 23:44:10 +00:00
Conrad Meyer
6ee287b9c2 libc: Delete unused rand.c ifdef TEST code 2020-01-20 23:43:47 +00:00
Jeff Roberson
1e40fe41c5 Reduce object locking in vm_fault. Once we have an exclusively busied page we
no longer need an object lock.  This reduces the longest hold times and
eliminates some trylock code blocks.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D23034
2020-01-20 22:49:52 +00:00
Dimitry Andric
f8e1cfad89 Merge commit bc4bc5aa0 from llvm git (by Justin Hibbits):
Add 8548 CPU definition and attributes

  8548 CPU is GCC's name for the e500v2, so accept this in clang.  The
  e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as
  well, as GCC does.

  Differential Revision:  https://reviews.llvm.org/D67787

Merge commit ff0311c4b from llvm git (by Justin Hibbits):

  [PowerPC]: Add powerpcspe target triple subarch component

  Summary:
  This allows the use of '-target powerpcspe-unknown-linux-gnu' or
  'powerpcspe-unknown-freebsd' to be used, instead of '-target
  powerpc-unknown-linux-gnu -mspe'.

  Reviewed By: dim
  Differential Revision: https://reviews.llvm.org/D72014

Merge commit ba91dffaf from llvm git (by Fangrui Song):

  [Driver][PowerPC] Move powerpcspe logic from cc1 to Driver

  Follow-up of D72014. It is more appropriate to use a target feature
  instead of a SubTypeArch to express the difference.

  Reviewed By: #powerpc, jhibbits

  Differential Revision: https://reviews.llvm.org/D72433

commit 36eedfcb3 from llvm git (by Justin Hibbits):

  [PowerPC] Fix powerpcspe subtarget enablement in llvm backend

  Summary:

  As currently written, -target powerpcspe will enable SPE regardless
  of disabling the feature later on in the command line.  Instead,
  change this to just set a default CPU to 'e500' instead of a generic
  CPU.

  As part of this, add FeatureSPE to the e500 definition.

  Reviewed By: MaskRay
  Differential Revision: https://reviews.llvm.org/D72673

These are needed to unbreak the build for powerpcspe.

Requested by:	jhibbits
MFC after:	1 week
2020-01-20 20:10:28 +00:00
Mariusz Zaborski
0581ad70b7 When MK_CASPER=no is set remove files which are not needed to run system.
PR:		242971
2020-01-20 19:56:22 +00:00
Mateusz Guzik
6403455301 cache: revert r352613 now that vhold does not take locks 2020-01-20 19:52:23 +00:00
Mariusz Zaborski
3d37949e21 Even when the MK_CASPER is set to "no" we still want to install man pages
and the headers. If the user decides to install the system without Casper
support, then the Casper functions are mocked, but they still exist in
the system.

PR:		242971
MFC after:	2 weeks
2020-01-20 19:51:53 +00:00
Mariusz Zaborski
c31a062f1a Those files are already removed in ObsoleteFiles.\
There is no need to remove them twice.

PR:		242971
MFC after:	2 weeks
2020-01-20 19:47:58 +00:00
Mikael Urankar
9932f32f32 Add myself (mikael) as a ports committer
Approved by:	manu (mentor)
Differential Revision:	https://reviews.freebsd.org/D23227
2020-01-20 19:38:29 +00:00