Commit graph

2614 commits

Author SHA1 Message Date
Konstantin Belousov
db4a2731e9 rtld: initialize default dlerror_seen_val as true
PR:	255698

(cherry picked from commit 529ab5a759)
2021-05-19 06:13:14 +03:00
Konstantin Belousov
29b896e67d rtld: preserve the 'seen' state of the dlerror message in errmsg_save()
PR:	255698

(cherry picked from commit 630caa95d4)
2021-05-19 06:13:14 +03:00
Lutz Donnerhacke
e0f2b8aaf1 service/ipfw: Silence warning on restart
Once the ipfw0 interface has been created, ifconfig(8) create will
throw a warning: "ifconfig: create: bad value" when trying to create
it again.

PR:		241013
Submitted by:	Jose Luis Duran
Approved by:	kp
Differential Revision: https://reviews.freebsd.org/D30083

(cherry picked from commit 5c4fe2ac81)
2021-05-17 08:08:41 +02:00
Kristof Provost
3711a14493 (t)ftp-proxy: use libpfctl
Reviewed by:	glebius
MFC after:	4 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D29641

(cherry picked from commit 95be9288f0)
2021-05-07 10:15:42 +02:00
Konstantin Belousov
13e0ef8230 rtld_lock.h: add some comments about versioning of struct RtldLockInfo
(cherry picked from commit 9b33518ada)
2021-04-23 14:14:08 +03:00
Konstantin Belousov
7bbfb5d959 rtld: make dlerror() thread-local
(cherry picked from commit 4d9128da54)
2021-04-23 14:14:08 +03:00
Konstantin Belousov
b75aa0eaf3 rtld: workaround for broken ABI
(cherry picked from commit 08bfbd4359)
2021-04-23 14:14:08 +03:00
Konstantin Belousov
fe86eb8f34 rtld: unstaticise lockinfo and obj_from_addr()
(cherry picked from commit 4d7f08c84b)
2021-04-23 14:14:08 +03:00
Konstantin Belousov
b26e7715b0 rtld: use _get_tp() in __tls_get_addr()
(cherry picked from commit e8b9c508b7)
2021-04-23 14:14:07 +03:00
Konstantin Belousov
e703bd6341 rtld: avoid recursing on rtld_bind_lock for write
(cherry picked from commit 7cb32a0d03)
2021-04-23 14:14:07 +03:00
Konstantin Belousov
ab34960582 rtld: allow to use tls_get_addr_slow() from context where rtld_bind_lock is locked
(cherry picked from commit 8950804842)
2021-04-23 14:14:07 +03:00
Konstantin Belousov
127849157a rtld: style tls_get_addr_slow
(cherry picked from commit 85d846b369)
2021-04-23 14:14:07 +03:00
Konstantin Belousov
4bcc2e90a0 rtld: define TLS_DTV_OFFSET on all architectures
(cherry picked from commit 99c2ce7ef1)
2021-04-23 14:14:07 +03:00
Konstantin Belousov
520806c476 rtld_lock.h: Expand scope for IN_RTLD to avoid some conflicts with libc
(cherry picked from commit 34ca6025dd)
2021-04-23 14:14:07 +03:00
Konstantin Belousov
d252df1e11 rtld/x86/reloc.c: style
(cherry picked from commit f61ecf60cf)
2021-04-23 14:14:06 +03:00
Konstantin Belousov
1bcab3da2b rtld_lock.h: remove tautological extern's
(cherry picked from commit 38e0610df7)
2021-04-23 14:14:06 +03:00
Konstantin Belousov
c3f97dd75a rtld dl_iterate_phdr(): dlpi_tls_data is wrong
(cherry picked from commit d36d681615)
2021-04-23 14:14:06 +03:00
Rick Macklem
85ad493677 mountd(8): generate a syslog message when the "V4:" line is missing
Daniel reported that NFSv4 mounts were not working despite having
set "nfsv4_server_enable=YES" in /etc/rc.conf.  Mountd was logging a
message that there was no /etc/exports file.
He noted that creating a /etc/exports file with a "V4:" line in it
was needed make NFSv4 mounts work.
At least one "V4:" line in one of the exports(5) file(s) is needed to
make NFSv4 mounts work. This patch fixes mountd.c so that it logs a
message indicting that there is no "V4:" line in any exports(5)
file when NFSv4 mounts are enabled.
To avoid this message being generated erroneously, /etc/rc.d/mountd
is updated to make sure vfs.nfsd.server_max_nfsvers is properly set
before mountd(8) is started.

PR:	253901

(cherry picked from commit 09673fc0f3)
2021-03-27 12:52:15 -07:00
Dag-Erling Smørgrav
c6aa83342e MFC: Fix post-start check when unbound.conf has moved.
On behalf of:	des
Reported by:	phk@
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 409388cfac)
2021-03-23 20:56:33 -04:00
Alex Richardson
e0b0299057 rc.d/auditd: set pidfile
auditd creates a pidfile so we should use it for status checks.
This also seems to speed up the frequent onestatus checks used in
tests/sys/audit.

Reviewed By:	asomers
Differential Revision: https://reviews.freebsd.org/D28389

(cherry picked from commit bcc5b24456)
2021-03-17 09:53:17 +00:00
Rick Macklem
59f6f5e23c nfs-over-tls: add rc scripts for rpc.tlsclntd and rpc.tlsservd
Add rc.d scripts that control the recently committed rpc.tlsclntd(8)
and rpc.tlsservd(8) daemons.

(cherry picked from commit 2f48313ab2)
2021-03-05 13:55:44 -08:00
Edward Tomasz Napierala
5dc2e1bcf4 Don't check compat.linux.emul_path before loading linux(4)
Fix e40787f900 to make libexec/rc/rc.d/linux retrieve the sysctl
after loading the kernel module which provides it, not before.

Reported By:	jkim
Sponsored By:	The FreeBSD Foundation

(cherry picked from commit 07cac176fb)
2021-03-02 18:43:26 +00:00
Edward Tomasz Napierala
1b2802ed4e Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linux
In /etc/rc.d/linux the mounting paths of procfs, sysfs and devfs
are hardcoded to "/compat/linux".  Switching to the content of
compat.linux.emul_path sysctl would allow to switch linuxulator
to different place.

Submitted by:	freebsdnewbie_freenet.de
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27807

(cherry picked from commit e40787f900)
2021-03-02 18:43:26 +00:00
Chris Rees
ce94bedf47 Create dhclient pid directory if it doesn't exist
- Upgrading from older FreeBSD versions can result in errors

 - /var/run can be a tmpfs, and this should be handled correctly

Approved by:	markj
Differential:	https://reviews.freebsd.org/D28843
MFC after:	2 weeks
2021-03-02 18:12:34 +00:00
David Chisnall
7d9e00cd8b rtld: Fix null-pointer dereference
(cherry picked from commit 43d44842ae)
2021-02-09 06:14:48 +02:00
Kyle Evans
13de72571e stand: lua: enhance lfs.dir() to speed up kernels_autodetect
This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

(cherry picked from commit e25ee296c9)
2021-02-03 00:55:47 -06:00
Glen Barber
bfd1570515 Create the stable/13 branch
Prune *-NODEBUG kernels.
Turn off debug options.
Bump to ALPHA2.

Approved by:	re (implicit)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-01-21 19:08:57 -05:00
Stefan Eßer
24f44a445c Remove dependency on files in /usr/bin
In order to reduce the pre-requisites of this file, implement the
pattern matching and creation of a temporary test directory without
use of grep respectively mktemp.

The new version makes it possible to provide a writable /tmp in any
case and independently of other local or remote file systems (except /
and /dev) being mounted.

The use of "dd if=/dev/random" has the same dependency on /dev/random
being operational as the previous version that used "mktemp". If this
is found to be an issue on platforms that do not have gathered
sufficient entropy at the time when this scriot is run, I suggest to
replace the "dd" command with "ps lauxww" to get a somewhat random
test directory name.

Approved by:	rgrimes, glebius, cy
MFC after:	4 weeks
Differential Revision:	https://reviews.freebsd.org/D28209
2021-01-19 12:56:23 +01:00
Marius Strobl
33b486472e bluetooth: remove support for bt3c(4)
The latter has been removed in 23e124c78b.
2021-01-16 23:53:13 +01:00
Gleb Smirnoff
4f48fd7c56 Add 'tmp' to the list of FILESYSTEMS dependencies. Some scripts that
depend on FILESYSTEMS run mktemp(1).  For systems that have read-only
root this is broken until memory disk based /tmp is instantiated.  At
least 'os-release' and 'motd' are subject to this problem.

Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D28097
2021-01-15 12:44:06 -08:00
Gleb Smirnoff
7e4eca7136 Revert 97ec6eba65. There shouldn't be a dependency of 'tmp' on
remote filesystems.  Discussed this with Brooks and he can't find
evidence that provoked the change in 2005.  If anything gets broken
I will fix it in a different way, not via rc sequence change.

Discussed with:		brooks
Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D28097
2021-01-15 12:44:06 -08:00
Gleb Smirnoff
425f68e6ce Follow-up on 51da4b19be. When booting a system with WITHOUT_IPFILTER
the following warning printed at boot time:

  rcorder: requirement `ipfs' in file `/etc/rc.d/netif' has no providers.

Close that using BEFORE rather than REQUIRE for writing down
dependencies of optional components.
2021-01-11 12:36:54 -08:00
Gleb Smirnoff
2903606b60 Add missing rcvar name for os-release. 2021-01-11 08:36:37 -08:00
Ed Maste
10cc3e39d6 Retire obsolete a.out rtld
This was disconnected from the build in 2001 in commit 66422f5b7a
with a comment that it was long overdue even then.

Sponsored by:	The FreeBSD Foundation
2021-01-07 18:50:01 -05:00
Ed Maste
613a08cfa2 rtld: map without PROT_EXEC for relocation
This makes text segment relocation work under W^X.

Submitted by:	Greg V <greg@unrelenting.technology> (original version)
Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27953
2021-01-05 10:57:14 -05:00
Emmanuel Vadot
e3ff9a1f2e pkgbase: Put the last rc files in the rc package
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D27718
2021-01-04 16:21:13 +01:00
Emmanuel Vadot
066a8c691e pkgbase: Install atf and kyua in the tests package
While here make sure that all tests dirs are taggued correctly.

Reviewed by:	bapt, emaste
Differential Revision:	https://reviews.freebsd.org/D27714
2021-01-04 16:20:47 +01:00
Konstantin Belousov
741d78126b rtld: call close(2) after errno is saved
to prevent obliteration of error value from the original syscall.
Also improve error message for short read.

Submitted by:	Konrad Sewiłło-Jopek
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27864
2021-01-02 04:43:32 +02:00
Ryan Libby
63f93c7e11 rtld-elf: link libcompiler_rt on all architectures
Statically link rtld-elf with libcompiler_rt on all architectures so
that we don't need to try to pick and choose the bits we need from it
for each architecture (we now leave that to the linker).  Compilers may
emit calls to support functions in this library, but because of the use
of the linker flag -nostdlib for rtld's special needs, the library is
not linked as normal.

Previously we had two different solutions.  On some architectures, we
were able to extract reimplementations of the necessary builtin
functions from our special build of libc.  On ARM, we just linked
libcompiler_rt.

This is motivated by the same issue as D26199 and D27665, but should be
a simpler solution that will apply to all architectures.

Reviewed by:	arichardson, kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27736
2020-12-28 00:44:25 -08:00
Ryan Libby
85b8932d0a Revert "rtld-elf: link udivmoddi4 from compiler_rt"
This reverts commit bce2cff0bc.

Revert D27665 in favor of a more general fix coming in D27736.
2020-12-28 00:44:25 -08:00
Marius Strobl
b58c853edf rtld-elf(1): remove obsolete pre_init() hook
It's no longer used since 600ee699ed
and r358358 respectively.
2020-12-25 19:47:46 +01:00
Ryan Libby
bce2cff0bc rtld-elf: link udivmoddi4 from compiler_rt
This fixes the gcc9 build of rtld-elf32 on amd64, which needed an
implementation of udivmoddi4.

rtld-elf uses certain functions normally found in libc, and so it
includes certain files from libc in its own build.  It has two
mechanisms to include files from libc: one that rebuilds source files in
the rtld-elf environment, and one that extracts object files from a
purpose-built no-SSP PIC archive.

In addition to libc functions, rtld-elf may need to link functions
normally found in libcompiler_rt (formerly libgcc).  Now, add an ability
to rebuild libcompiler_rt source files in the rtld-elf environment.  We
don't yet have a need for an object file extraction mechanism.

libcompiler_rt could also supply udivdi3 and umoddi3, but leave them
alone for now.

Reviewed by:	arichardson, kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27665
2020-12-19 08:38:31 +00:00
Ryan Libby
198a0e58ec rtld-libc: fix incremental build
ar cr is an update of an archive, not a creation of a new one.  During
incremental builds (e.g. with meta mode) the archive was not getting
cleaned, and so could retain now-deleted objects from previous builds.
Now, delete the archive before creating/updating it.

Reviewed by:	arichardson, bdrewery, kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27663
2020-12-19 08:38:27 +00:00
Mark Johnston
5120612664 Fix the ipfw service status output when ipfw.ko isn't loaded
Reported by:	lme
Reviewed by:	lme
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27657
2020-12-18 16:02:28 +00:00
Rick Macklem
31b29217ab Make mountcritremote dependent upon nfscbd.
Although it is not often needed, the nfscbd(8) should be running when
NFSv4 mounts are done if callback functionality is required.
Callback functionality is required for the NFSv4 server to issue
delegations or pNFS layouts.

This patch adds nfscbd to the mountcritremote's REQUIRED line
to ensure it is started before NFS mounts specified in /etc/fstab
are done.

Reviewed by:	0mp
Differential Revision:	https://reviews.freebsd.org/D27506
2020-12-17 00:20:57 +00:00
Michael Tuexen
1d0272a600 When receiving a file having a length, which is a mulitple of the blocksize,
close the file once it is received.

Reported by:	Timo Voelker
MFC after:	1 week
2020-12-15 09:43:18 +00:00
Michael Tuexen
3696db923f Improve the counting of blocks used to transfer a file from the
server to the client in case of not using an OACK: Don't miss
the first block in case of it is not also the last one.

MFC after:		1 week
2020-12-14 22:13:58 +00:00
Michael Tuexen
1f67c37c1f Fix the TFTP client when performing a RRQ for files smaller than 512 bytes
and the server not sending an OACK:
* Close the file.
* Report the correct the number of received blocks.

MFC after:		1 week
2020-12-10 19:36:33 +00:00
Michael Tuexen
a1c4a3eaf1 When dropping packets (RRQ or WRQ) for debugging, report the send
operation as successful. Reporting a failure stops the transfer
instead of using timeouts.

MFC after:		1 week
2020-12-06 18:43:12 +00:00
Conrad Meyer
78599c32ef Add CFI start/end proc directives to arm64, i386, and ppc
Follow-up to r353959 and r368070: do the same for other architectures.

arm32 already seems to use its own .fnstart/.fnend directives, which
appear to be ARM-specific variants of the same thing.  Likewise, MIPS
uses .frame directives.

Reviewed by:	arichardson
Differential Revision:	https://reviews.freebsd.org/D27387
2020-12-05 00:33:28 +00:00