]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agosd-netlink: make TCA_OPTIONS take NETLINK_TYPE_UNION
Yu Watanabe [Wed, 11 Dec 2019 07:30:39 +0000 (16:30 +0900)] 
sd-netlink: make TCA_OPTIONS take NETLINK_TYPE_UNION

4 years agoMerge pull request #14278 from ssahani/tc
Yu Watanabe [Wed, 11 Dec 2019 04:27:14 +0000 (13:27 +0900)] 
Merge pull request #14278 from ssahani/tc

network tc: qdisc parent add support to set ingress

4 years agoMerge pull request #14297 from poettering/id128-size
Yu Watanabe [Wed, 11 Dec 2019 04:26:51 +0000 (13:26 +0900)] 
Merge pull request #14297 from poettering/id128-size

cleaning up id128 formatting buffer sizing

4 years agoipv4ll: do not reset conflict counter on restart
AJ Bagwell [Tue, 10 Dec 2019 16:27:31 +0000 (16:27 +0000)] 
ipv4ll: do not reset conflict counter on restart

Don't reset the conflict counter when trying a new pseudo random
address, so that after trying 10 addresses the londer timeout is used in
accordance with the RFC

Fixes #14299.

4 years agotest-network: add a test case for fq-codel 14278/head
Yu Watanabe [Tue, 10 Dec 2019 14:46:38 +0000 (23:46 +0900)] 
test-network: add a test case for fq-codel

4 years agonetwork tc: Add support to conkfigure CoDel - Controlled-Delay Active Queue Managemen...
Susant Sahani [Sat, 7 Dec 2019 19:48:18 +0000 (20:48 +0100)] 
network tc: Add support to conkfigure CoDel - Controlled-Delay Active Queue Management algorithm

```
$ tc qdisc show dev dummy99
qdisc fq_codel 8005: dev dummy99 root refcnt 2 limit 1000p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb ecn
$ network cat dumm99.network
[Match]
Name=dummy99

[TrafficControlQueueingDiscipline]
Parent=root
FairQueuingControlledDelayPacketLimit=1000

```

4 years agonetwork tc: qdisc parent add support to set ingress
Susant Sahani [Sat, 7 Dec 2019 16:46:37 +0000 (17:46 +0100)] 
network tc: qdisc parent add support to set ingress

```
$ network tc qdisc
qdisc noqueue 0: dev dummy99 root refcnt 2
qdisc ingress ffff: dev dummy99 parent ffff:fff1 ----------------

$ network cat dumm99.network
[Match]
Name=dummy99

[TrafficControlQueueingDiscipline]
Parent=ingress
```

4 years agoMerge pull request #14280 from yuwata/network-tbf-more
Yu Watanabe [Tue, 10 Dec 2019 15:02:43 +0000 (00:02 +0900)] 
Merge pull request #14280 from yuwata/network-tbf-more

network: tc: add more options for TBF

4 years agoMerge pull request #14295 from poettering/greedy-alloc-round-up
Yu Watanabe [Tue, 10 Dec 2019 11:17:33 +0000 (20:17 +0900)] 
Merge pull request #14295 from poettering/greedy-alloc-round-up

add new GREEDY_ALLOC_ROUND_UP() to make strv_extend() a bit less slow

4 years agotree-wide: use SD_ID128_STRING_MAX where appropriate 14297/head
Lennart Poettering [Tue, 10 Dec 2019 10:52:54 +0000 (11:52 +0100)] 
tree-wide: use SD_ID128_STRING_MAX where appropriate

4 years agoid128: introduce ID128_UUID_STRING_MAX for sizing UUID buffers
Lennart Poettering [Tue, 10 Dec 2019 10:33:28 +0000 (11:33 +0100)] 
id128: introduce ID128_UUID_STRING_MAX for sizing UUID buffers

4 years agoMerge pull request #14284 from yuwata/network-fix-segfault-14283
Anita Zhang [Mon, 9 Dec 2019 21:33:36 +0000 (13:33 -0800)] 
Merge pull request #14284 from yuwata/network-fix-segfault-14283

network: fix segfault in parsing SendOption=

4 years agostrv: when growing strv arrays piecemeal actually allocate memory in exponential... 14295/head
Lennart Poettering [Mon, 9 Dec 2019 17:30:00 +0000 (18:30 +0100)] 
strv: when growing strv arrays piecemeal actually allocate memory in exponential steps

Let's improve memory allocation for call such as strv_extend() that just
one item to an strv: these are often called in a loop, where they used
to be very ineffecient, since we'd allocate byte-exact space. With this
change let's improve on that, by allocating exponentially by rounding up
to the next exponent of 2. This way we get GREEDY_REALLOC()-like
behaviour without passing around state.

In fact this should be good enough so that we could replace existing
loops around GREEDY_REALLOC() for strv build-up with plain strv_extend()
and get similar behaviour.

4 years agotest-util: add more tests for ALIGN_POWER2
Lennart Poettering [Mon, 9 Dec 2019 17:29:29 +0000 (18:29 +0100)] 
test-util: add more tests for ALIGN_POWER2

4 years agomacro: introduce new GREEDY_ALLOC_ROUND_UP() helper
Lennart Poettering [Mon, 9 Dec 2019 17:26:10 +0000 (18:26 +0100)] 
macro: introduce new GREEDY_ALLOC_ROUND_UP() helper

4 years agomacro: avoid subtraction overflow in ALIGN_POWER2()
Lennart Poettering [Mon, 9 Dec 2019 17:24:41 +0000 (18:24 +0100)] 
macro: avoid subtraction overflow in ALIGN_POWER2()

4 years agotest-network: add tests for new TBF settings 14280/head
Yu Watanabe [Sat, 7 Dec 2019 20:55:49 +0000 (05:55 +0900)] 
test-network: add tests for new TBF settings

4 years agonetwork: tc: add more options for TBF
Yu Watanabe [Sat, 7 Dec 2019 20:54:33 +0000 (05:54 +0900)] 
network: tc: add more options for TBF

4 years agotest-network: add a test case for SendOption= 14284/head
Yu Watanabe [Sun, 8 Dec 2019 10:54:49 +0000 (19:54 +0900)] 
test-network: add a test case for SendOption=

4 years agonetwork: fix segfault in parsing SendOption=
Yu Watanabe [Sun, 8 Dec 2019 10:54:20 +0000 (19:54 +0900)] 
network: fix segfault in parsing SendOption=

Fixes #14283.

4 years agoseccomp: real syscall numbers are >= 0
Mike Gilbert [Fri, 6 Dec 2019 19:28:13 +0000 (14:28 -0500)] 
seccomp: real syscall numbers are >= 0

Real syscall numbers start at 0. The fake seccomp values seem to be
strictly less than 0.

Fixes: 4df8fe8415eaf4abd5b93c3447452547c6ea9e5f
4 years agoAdd Cube iWork 11 Stylus
Yong Cong Sin [Sat, 7 Dec 2019 14:15:02 +0000 (01:15 +1100)] 
Add Cube iWork 11 Stylus

4 years agotest: do not fail if new device is plugged during enumeration
Yu Watanabe [Sun, 8 Dec 2019 15:57:06 +0000 (00:57 +0900)] 
test: do not fail if new device is plugged during enumeration

4 years agotest-network: make test_bind_carrier more stable
Yu Watanabe [Sun, 8 Dec 2019 15:39:33 +0000 (00:39 +0900)] 
test-network: make test_bind_carrier more stable

4 years agoMerge pull request #14266 from topimiettinen/dont-resolve-user-if-not-root
Yu Watanabe [Sun, 8 Dec 2019 15:15:31 +0000 (00:15 +0900)] 
Merge pull request #14266 from topimiettinen/dont-resolve-user-if-not-root

resolved: don't resolve the user if not root

4 years agoMerge pull request #14273 from ssahani/ifb
Yu Watanabe [Sat, 7 Dec 2019 20:13:08 +0000 (05:13 +0900)] 
Merge pull request #14273 from ssahani/ifb

network: introduce IFB

4 years agonetwork: fix copy and paste mistake
Yu Watanabe [Sat, 7 Dec 2019 14:20:37 +0000 (23:20 +0900)] 
network: fix copy and paste mistake

4 years agoresolved, networkd: don't resolve the user if not root 14266/head
Topi Miettinen [Fri, 6 Dec 2019 14:36:58 +0000 (16:36 +0200)] 
resolved, networkd: don't resolve the user if not root

If a daemon is not started as root, most likely it also can't create its
directory and let's not try to resolve the user in that case either.

Create /run/systemd/netif/lldp with tmpfiles.d like other netif directories.

This is also very helpful for preparing a RootImage for the daemons as NSS crud
is not needed.

4 years agotest-network: add test case for IFB 14273/head
Yu Watanabe [Sat, 7 Dec 2019 15:03:29 +0000 (00:03 +0900)] 
test-network: add test case for IFB

4 years agonetwork: introduce ifb (Intermediate Functional Block)
Susant Sahani [Sat, 7 Dec 2019 13:35:55 +0000 (14:35 +0100)] 
network: introduce ifb (Intermediate Functional Block)

Intermediate Functional Block

The Intermediate Functional Block (ifb) pseudo network interface acts as a QoS concentrator for multiple different sources of traffic. Packets from or to other interfaces have to be redirected to it using the mirred action in order to be handled, regularly routed traffic will be dropped. This way, a single stack of qdiscs, classes and filters can be shared between multiple interfaces.

Here's a simple example to feed incoming traffic from multiple interfaces through a Stochastic Fairness Queue (sfq):

(1) # modprobe ifb
(2) # ip link set ifb0 up
(3) # tc qdisc add dev ifb0 root sfq

4 years agosd-netlink: add support for ifb device
Susant Sahani [Sat, 7 Dec 2019 13:35:23 +0000 (14:35 +0100)] 
sd-netlink: add support for ifb device

4 years agoMerge pull request #14102 from ssahani/acd-duplicate-ip
Yu Watanabe [Sat, 7 Dec 2019 05:11:44 +0000 (14:11 +0900)] 
Merge pull request #14102 from ssahani/acd-duplicate-ip

network: introduce DAD for static IPV4 address

4 years agoMerge pull request #14265 from keszybz/seccomp-log-line-fix
Anita Zhang [Fri, 6 Dec 2019 19:02:56 +0000 (11:02 -0800)] 
Merge pull request #14265 from keszybz/seccomp-log-line-fix

shared/seccomp: avoid possibly writing bogus errno code in debug log

4 years agotest-network: add test case for IPv4 DAD 14102/head
Yu Watanabe [Fri, 6 Dec 2019 14:29:28 +0000 (23:29 +0900)] 
test-network: add test case for IPv4 DAD

4 years agonetwork: introduce DAD for static address
Susant Sahani [Thu, 21 Nov 2019 15:54:52 +0000 (16:54 +0100)] 
network: introduce DAD for static address

Closes #2527.

4 years agoshared/seccomp: avoid possibly writing bogus errno code in debug log 14265/head
Zbigniew Jędrzejewski-Szmek [Fri, 6 Dec 2019 14:04:51 +0000 (15:04 +0100)] 
shared/seccomp: avoid possibly writing bogus errno code in debug log

CID 1409488.

This code was added in 903659e7b242c3cc897e32835f1918d380b24e5f. The change
that is done here is a simple fix to avoid use of a
unitialized/wrongly-initialized variable, but the bigger issue is that nothing
looks at the returned result to distinguish between 0 and a positive return
value.

4 years agoMerge pull request #14235 from fbuihuu/cryptsetup-fixes
Zbigniew Jędrzejewski-Szmek [Fri, 6 Dec 2019 11:46:42 +0000 (12:46 +0100)] 
Merge pull request #14235 from fbuihuu/cryptsetup-fixes

Cryptsetup fixes

4 years agonetwork: do not drop foreign config if interface is in initialized state
Yu Watanabe [Thu, 5 Dec 2019 10:54:29 +0000 (19:54 +0900)] 
network: do not drop foreign config if interface is in initialized state

If the interface is in initialized state, no network file is assigned to
the interface. If an interface is not managed by networkd, previously,
the foreign configs of the interface was dropped.

Fixes #14250.

4 years agoMerge pull request #14252 from keszybz/growfs-port-resizefs
Lennart Poettering [Fri, 6 Dec 2019 07:55:30 +0000 (08:55 +0100)] 
Merge pull request #14252 from keszybz/growfs-port-resizefs

Port growfs over to resizefs

4 years agoMerge pull request #14253 from keszybz/cleanups
Lennart Poettering [Fri, 6 Dec 2019 07:55:15 +0000 (08:55 +0100)] 
Merge pull request #14253 from keszybz/cleanups

Cleanups

4 years agoMerge pull request #14167 from cpaelzer/fix-MemoryDenyWriteExecute-x86-s390-bug-18538...
Lennart Poettering [Fri, 6 Dec 2019 07:54:54 +0000 (08:54 +0100)] 
Merge pull request #14167 from cpaelzer/fix-MemoryDenyWriteExecute-x86-s390-bug-1853852-UPSTREAM

Fix memory_deny_write_execute on x86 and s390 with libseccomp 2.4.2

4 years agoMerge pull request #14258 from TimoWilken/patch-1
Anita Zhang [Thu, 5 Dec 2019 18:55:20 +0000 (10:55 -0800)] 
Merge pull request #14258 from TimoWilken/patch-1

Fix typo (duplicate "or")

4 years agoFix typo (duplicate "or") 14258/head
Timo Wilken [Thu, 5 Dec 2019 18:36:57 +0000 (18:36 +0000)] 
Fix typo (duplicate "or")

This fixes a double "or" in the text of `systemctl --help`.

4 years agocryptsetup: umount encrypted devices before detaching it during shutdown 14235/head
Franck Bui [Tue, 3 Dec 2019 08:49:09 +0000 (09:49 +0100)] 
cryptsetup: umount encrypted devices before detaching it during shutdown

This is done by ordering local-fs-pre.target and remote-fs-pre.target after
cryptsetup.target and remote-cryptsetup.target respectively.

Fixes: #8472
4 years agocrypsetup: introduce x-initrd.attach option
Franck Bui [Tue, 3 Dec 2019 08:30:57 +0000 (09:30 +0100)] 
crypsetup: introduce x-initrd.attach option

This option is an indication for PID1 that the entry in crypttab is handled by
initrd only and therefore it shouldn't interfer during the usual start-up and
shutdown process.

It should be primarily used with the encrypted device containing the root FS as
we want to keep it (and thus its encrypted device) until the very end of the
shutdown process, i.e. when initrd takes over.

This option is the counterpart of "x-initrd.mount" used in fstab.

Note that the slice containing the cryptsetup services also needs to drop the
usual shutdown dependencies as it's required by the cryptsetup services.

Fixes: #14224
4 years agoTODO: remove obsolete entries 14253/head
Zbigniew Jędrzejewski-Szmek [Thu, 5 Dec 2019 09:31:55 +0000 (10:31 +0100)] 
TODO: remove obsolete entries

"introspect" is well established and OK. We shouldn't change it at this point.

4 years agoFix use of unitialized variable in error path
Zbigniew Jędrzejewski-Szmek [Wed, 4 Dec 2019 13:51:33 +0000 (14:51 +0100)] 
Fix use of unitialized variable in error path

CID 1408478.

4 years agoMerge pull request #14209 from poettering/sd-bus-sensitive
Zbigniew Jędrzejewski-Szmek [Thu, 5 Dec 2019 09:22:01 +0000 (10:22 +0100)] 
Merge pull request #14209 from poettering/sd-bus-sensitive

sd-bus bits from homed PR

4 years agoMerge pull request #14221 from poettering/homed-preparatory-resizefs
Zbigniew Jędrzejewski-Szmek [Thu, 5 Dec 2019 09:17:10 +0000 (10:17 +0100)] 
Merge pull request #14221 from poettering/homed-preparatory-resizefs

preparatory fs resizing support split out of homed PR

4 years agogrowfs: port over to resize_fs() 14252/head
Zbigniew Jędrzejewski-Szmek [Thu, 5 Dec 2019 09:15:49 +0000 (10:15 +0100)] 
growfs: port over to resize_fs()

4 years agogrowfs: define main function through macro
Zbigniew Jędrzejewski-Szmek [Thu, 5 Dec 2019 08:22:13 +0000 (09:22 +0100)] 
growfs: define main function through macro

4 years agoMerge pull request #14229 from yuwata/nspawn-network-interface-14223
Yu Watanabe [Thu, 5 Dec 2019 07:10:29 +0000 (16:10 +0900)] 
Merge pull request #14229 from yuwata/nspawn-network-interface-14223

nspawn: do not fail if udev is not running

4 years agoseccomp: mmap test results depend on kernel/libseccomp/glibc 14167/head
Christian Ehrhardt [Wed, 4 Dec 2019 10:44:32 +0000 (11:44 +0100)] 
seccomp: mmap test results depend on kernel/libseccomp/glibc

Like with shmat already the actual results of the test
test_memory_deny_write_execute_mmap depend on kernel/libseccomp/glibc
of the platform it is running on.

There are known-good platforms, but on the others do not assert success
(which implies test has actually failed as no seccomp blocking was achieved),
but instead make the check dependent to the success of the mmap call
on that platforms.

Finally the assert of the munmap on that valid pointer should return ==0,
so that is what the check should be for in case of p != MAP_FAILED.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
4 years agoseccomp: use per arch shmat_syscall
Christian Ehrhardt [Wed, 27 Nov 2019 09:53:50 +0000 (10:53 +0100)] 
seccomp: use per arch shmat_syscall

At the beginning of seccomp_memory_deny_write_execute architectures
can set individual filter_syscall, block_syscall, shmat_syscall values.
The former two are then used in the call to add_seccomp_syscall_filter
but shmat_syscall is not.

Right now all shmat_syscall values are the same, so the change is a
no-op, but if ever an architecture is added/modified this would be a
subtle source for a mistake so fix it by using shmat_syscall later.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
4 years agoseccomp: ensure rules are loaded in seccomp_memory_deny_write_execute
Christian Ehrhardt [Wed, 27 Nov 2019 08:57:55 +0000 (09:57 +0100)] 
seccomp: ensure rules are loaded in seccomp_memory_deny_write_execute

If seccomp_memory_deny_write_execute was fatally failing to load rules it
already returned a bad retval.
But if any adding filters failed it skipped the subsequent seccomp_load and
always returned an rc of 0 even if no rule was loaded at all.

Lets fix this requiring to (non fatally-failing) load at least one rule set.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
4 years agoseccomp: fix multiplexed system calls
Christian Ehrhardt [Wed, 27 Nov 2019 08:52:07 +0000 (09:52 +0100)] 
seccomp: fix multiplexed system calls

Since libseccomp 2.4.2 more architectures have shmat handled as multiplexed
call. Those will fail to be added due to seccomp_rule_add_exact failing
on them since they'd need to add multiple rules [1].
See the discussion at https://github.com/seccomp/libseccomp/issues/193

After discussions about the options rejected [2][3] the initial thought of
a fallback to the non '_exact' version of the seccomp rule adding the next
option is to handle those now affected (i386, s390, s390x) the same way as
ppc which ignores and does not block shmat.

[1]: https://github.com/seccomp/libseccomp/issues/193
[2]: https://github.com/systemd/systemd/pull/14167#issuecomment-559136906
[3]: https://github.com/systemd/systemd/commit/469830d1

4 years agoMerge pull request #14173 from ssahani/tc-sfq
Anita Zhang [Thu, 5 Dec 2019 00:14:11 +0000 (16:14 -0800)] 
Merge pull request #14173 from ssahani/tc-sfq

network: tc: introduce sfq and tbf

4 years agoMerge pull request #14219 from poettering/homed-preparatory-loop
Anita Zhang [Thu, 5 Dec 2019 00:07:41 +0000 (16:07 -0800)] 
Merge pull request #14219 from poettering/homed-preparatory-loop

preparatory /dev/loopN support split out of homed PR

4 years agonetwork: if /sys is rw, then udev should be around 14229/head
Yu Watanabe [Wed, 4 Dec 2019 10:12:36 +0000 (19:12 +0900)] 
network: if /sys is rw, then udev should be around

This switches detect_container() to path_is_read_only_rw("/sys"), as if
systemd-udevd.service is conditionalized with that way.

This also updates the log message.

4 years agonspawn: do not fail if udev is not running
Yu Watanabe [Mon, 2 Dec 2019 15:51:44 +0000 (00:51 +0900)] 
nspawn: do not fail if udev is not running

If /sys is read only filesystem, e.g., nspawn is running in container,
then usually udev is not running. In such a case, let's assume that
the interface is already initialized. Also, this makes nspawn refuse
to use the network interface which is under renaming.

Fixes #14223.

4 years agoImplement SNI when using DNS-over-TLS
Guilhem Lettron [Sat, 30 Nov 2019 02:51:40 +0000 (03:51 +0100)] 
Implement SNI when using DNS-over-TLS

Some DNS providers need SNI to identify client.

This can be used by adding #name to a DNS.
Example:
[Resolve]
DNS=192.168.1.1#example.com

4 years agoMerge pull request #14111 from keszybz/unknown-section-warning
Lennart Poettering [Wed, 4 Dec 2019 13:12:24 +0000 (14:12 +0100)] 
Merge pull request #14111 from keszybz/unknown-section-warning

Warn about unknown sections

4 years agosd-bus: don't include properties maked as "emit-invalidation" in InterfacesAdded... 14209/head
Lennart Poettering [Tue, 20 Aug 2019 13:35:53 +0000 (15:35 +0200)] 
sd-bus: don't include properties maked as "emit-invalidation" in InterfacesAdded signals

Properties marked this way really shouldn't be sent around willy-nilly,
that's what the flag is about, hence exclude it from InterfacesAdded
signals (and in fact anything that is a signal).

4 years agosd-bus: add new call sd_bus_message_sensitive() and SD_BUS_VTABLE_SENSITIVE
Lennart Poettering [Mon, 19 Aug 2019 18:28:34 +0000 (20:28 +0200)] 
sd-bus: add new call sd_bus_message_sensitive() and SD_BUS_VTABLE_SENSITIVE

This allows marking messages that contain "sensitive" data with a flag.
If it's set then the messages are erased from memory when the message is
freed.

Similar, a flag may be set on vtable entries: incoming/outgoing message
matching the entry will then automatically be flagged this way.

This is supposed to be an easy method to mark messages containing
potentially sensitive data (such as passwords) for proper destruction.

(Note that this of course is only is as safe as the broker in between is
doing something similar. But let's at least not be the ones at fault
here.)

4 years agoMerge pull request #13953 from SpencerMichaels/systemd-boot-efistub-id-fix
Zbigniew Jędrzejewski-Szmek [Wed, 4 Dec 2019 12:30:52 +0000 (13:30 +0100)] 
Merge pull request #13953 from SpencerMichaels/systemd-boot-efistub-id-fix

boot: Fix default/oneshot selection for EFISTUB entries

4 years agoMerge pull request #14218 from poettering/homed-preparatory-small-stuff
Lennart Poettering [Wed, 4 Dec 2019 12:13:38 +0000 (13:13 +0100)] 
Merge pull request #14218 from poettering/homed-preparatory-small-stuff

Assorted smaller stuff split out from homed PR

4 years agoMerge pull request #13886 from poettering/sd-event-pidfd
Lennart Poettering [Wed, 4 Dec 2019 12:13:18 +0000 (13:13 +0100)] 
Merge pull request #13886 from poettering/sd-event-pidfd

add pidfd support to sd-event (but not yet PID 1)

4 years agotest-network: add a test case for SFQ 14173/head
Yu Watanabe [Tue, 3 Dec 2019 14:20:50 +0000 (23:20 +0900)] 
test-network: add a test case for SFQ

4 years agonetwork: SFQ cannot be configured with netem or TBF
Yu Watanabe [Tue, 3 Dec 2019 14:12:00 +0000 (23:12 +0900)] 
network: SFQ cannot be configured with netem or TBF

4 years agonetwork: tc introduce sfq - Stochastic Fairness Queueing
Susant Sahani [Wed, 27 Nov 2019 11:42:21 +0000 (12:42 +0100)] 
network: tc introduce sfq - Stochastic Fairness Queueing

Stochastic Fairness Queueing is a classless queueing discipline.
SFQ does not shape traffic but only schedules the transmission of packets, based on 'flows'.
The goal is to ensure fairness so that each flow is able to send data in turn,
thus preventing any single flow from drowning out the rest.

4 years agotest-network: add test case for TBF
Yu Watanabe [Sun, 24 Nov 2019 12:23:48 +0000 (21:23 +0900)] 
test-network: add test case for TBF

4 years agonetwork: drop unnecessary headers
Yu Watanabe [Mon, 25 Nov 2019 14:15:08 +0000 (23:15 +0900)] 
network: drop unnecessary headers

4 years agonetwork: make network_emulator_fill_message() take NetworkEmulator
Yu Watanabe [Mon, 25 Nov 2019 14:13:54 +0000 (23:13 +0900)] 
network: make network_emulator_fill_message() take NetworkEmulator

4 years agonetwork: rename QDiscs to QDisc
Yu Watanabe [Mon, 25 Nov 2019 14:07:58 +0000 (23:07 +0900)] 
network: rename QDiscs to QDisc

4 years agonetwork: ignore sections which have both NetworkEmulator and TokenBufferFilter settings
Yu Watanabe [Sun, 24 Nov 2019 11:31:38 +0000 (20:31 +0900)] 
network: ignore sections which have both NetworkEmulator and TokenBufferFilter settings

4 years agonetworkd tc: introduce tbf
Susant Sahani [Sun, 17 Nov 2019 06:30:03 +0000 (07:30 +0100)] 
networkd tc: introduce tbf

See https://linux.die.net/man/8/tc-tbf

4 years agoshared: add new wrapper for online fs resizing ioctls 14221/head
Lennart Poettering [Thu, 27 Dec 2018 13:31:27 +0000 (14:31 +0100)] 
shared: add new wrapper for online fs resizing ioctls

4 years agomissing: add XFS magic
Lennart Poettering [Fri, 28 Dec 2018 18:01:53 +0000 (19:01 +0100)] 
missing: add XFS magic

4 years agomain-func: send main exit code to parent via sd_notify() on exit 14218/head
Lennart Poettering [Fri, 17 May 2019 08:17:06 +0000 (10:17 +0200)] 
main-func: send main exit code to parent via sd_notify() on exit

So far we silently convert negative return values from run() as
EXIT_FAILURE, which is how UNIX expects it. In many cases it would be
very useful for the caller to retrieve the actual error number we exit
with. Let's generically return that via sd_notify()'s ERRNO= attribute.
This means callers can set $NOTIFY_SOCKET and get the actual error
number delivered at their doorstep just like that.

4 years agoprocess-util: add new safe_fork() flag for connecting stdout to stderr
Lennart Poettering [Mon, 6 May 2019 20:38:43 +0000 (22:38 +0200)] 
process-util: add new safe_fork() flag for connecting stdout to stderr

This adds a new safe_fork() flag. If set the child process' fd 1 becomes
fd 2 of the caller. This is useful for invoking tools (such as various
mkfs/fsck implementations) that output status messages to stdout, but
which we invoke and don't want to pollute stdout with their output.

4 years agotmpfile-util: modernize mkostemp_safe() a bit
Lennart Poettering [Thu, 4 Jul 2019 14:48:32 +0000 (16:48 +0200)] 
tmpfile-util: modernize mkostemp_safe() a bit

4 years agotmpfile-util: if no path is passed to fopen_temporary() make one up
Lennart Poettering [Tue, 23 Apr 2019 13:23:48 +0000 (15:23 +0200)] 
tmpfile-util: if no path is passed to fopen_temporary() make one up

Let's beef up functionality a bit, and modernize the whole function.

4 years agouser-util: add uid_is_container() for checking whether UID is in container range
Lennart Poettering [Wed, 7 Aug 2019 10:34:46 +0000 (12:34 +0200)] 
user-util: add uid_is_container() for checking whether UID is in container range

We have similar calls for the dynamic user and system range, let's add
this too here.

4 years agouser-util: export is_nologin_shell() so that we can use it elsewhere
Lennart Poettering [Wed, 7 Aug 2019 10:34:29 +0000 (12:34 +0200)] 
user-util: export is_nologin_shell() so that we can use it elsewhere

4 years agoman: document journal rate limit burst multiplier
Charles (Chas) Williams [Thu, 21 Nov 2019 15:26:24 +0000 (10:26 -0500)] 
man: document journal rate limit burst multiplier

The actual burst limit is modified by the remaining disk space. This
isn't mentioned anywhere in the available documentation and might be a
source of surprise for an end user expecting certain behaviors.

4 years agostring-util: readd string_erase()
Lennart Poettering [Thu, 11 Jul 2019 12:50:26 +0000 (14:50 +0200)] 
string-util: readd string_erase()

This was dropped in 8e27167cc9b8beda2bf49789b15f0b0301b95d17, but is
actually useful for some usecases still.

4 years agomemory-util: introduce erase_and_free() helper
Lennart Poettering [Thu, 8 Aug 2019 17:53:17 +0000 (19:53 +0200)] 
memory-util: introduce erase_and_free() helper

4 years agoerrno-util: add new ERRNO_IS_DISK_SPACE() helper
Lennart Poettering [Mon, 15 Jul 2019 11:32:03 +0000 (13:32 +0200)] 
errno-util: add new ERRNO_IS_DISK_SPACE() helper

4 years agoordered-set: add ordered_set_first() helper
Lennart Poettering [Mon, 19 Aug 2019 16:06:03 +0000 (18:06 +0200)] 
ordered-set: add ordered_set_first() helper

4 years agoparse-util: sometimes it is useful to check if a string is a valid integer, but not...
Lennart Poettering [Thu, 14 Nov 2019 13:49:40 +0000 (14:49 +0100)] 
parse-util: sometimes it is useful to check if a string is a valid integer, but not actually parse it

4 years agosd-boot: Add a 0.1 second delay before key-probing for showing menu
Leonid Bloch [Sun, 1 Dec 2019 23:05:02 +0000 (01:05 +0200)] 
sd-boot: Add a 0.1 second delay before key-probing for showing menu

If there is no boot menu timeout, pressing a key during boot should get
the boot menu displayed. However, on some systems the keyboard is not
initialized right away, which causes the menu to be inaccessible if no
timeout is specified.

To resolve this, if the error is "not ready" after the initial attempt of
detection, wait for 0.1 second and retry. This solves the problem
described above on all the tested systems.

The reason for just a single retry, and not retrying while "not ready",
is that some firmwares continue to return the "not ready" error on
every probe attempt if no key is pressed.

Signed-off-by: Leonid Bloch <lb.workbox@gmail.com>
4 years agosd-event: refuse running default event loops in any other thread than the one they... 13886/head
Lennart Poettering [Wed, 30 Oct 2019 19:26:50 +0000 (20:26 +0100)] 
sd-event: refuse running default event loops in any other thread than the one they are default for

4 years agoman: document the new sd-event pidfd magic
Lennart Poettering [Wed, 30 Oct 2019 18:00:12 +0000 (19:00 +0100)] 
man: document the new sd-event pidfd magic

4 years agoman: mention that SIGCHLD has to be blocked before using sd_event_add_child()
Lennart Poettering [Wed, 30 Oct 2019 17:59:44 +0000 (18:59 +0100)] 
man: mention that SIGCHLD has to be blocked before using sd_event_add_child()

4 years agoman: don't claim we'd unblock the specified signal in sd_event_add_signal()
Lennart Poettering [Wed, 30 Oct 2019 17:56:03 +0000 (18:56 +0100)] 
man: don't claim we'd unblock the specified signal in sd_event_add_signal()

We don't, the signal remains blocked. We use signalfd() to be able to
read the signal events without unblocking the signal.

While we are at it, mention that pthread_sigmask() is fine too.

4 years agotest: add test for pidfd support in sd-event
Lennart Poettering [Wed, 30 Oct 2019 16:42:31 +0000 (17:42 +0100)] 
test: add test for pidfd support in sd-event

4 years agosd-event: refuse sd_event_add_child() if SIGCHLD is not blocked
Lennart Poettering [Wed, 30 Oct 2019 16:41:15 +0000 (17:41 +0100)] 
sd-event: refuse sd_event_add_child() if SIGCHLD is not blocked

We already refuse sd_event_add_signal() if the specified signal is not
blocked, let's do this also for sd_event_add_child(), since we might
need signalfd() to implement this, and this means the signal needs to be
blocked.

4 years agosd-event: make use of new signal_is_blocked() helper
Lennart Poettering [Wed, 30 Oct 2019 16:37:12 +0000 (17:37 +0100)] 
sd-event: make use of new signal_is_blocked() helper

4 years agosignal-util: add new helper signal_is_blocked()
Lennart Poettering [Wed, 30 Oct 2019 16:37:00 +0000 (17:37 +0100)] 
signal-util: add new helper signal_is_blocked()

4 years agosd-event: add pidfd support
Lennart Poettering [Wed, 30 Oct 2019 16:22:49 +0000 (17:22 +0100)] 
sd-event: add pidfd support

This adds support for watching for process exits via Linux new pidfd
concept. This makes watching processes and killing them race-free if
properly used, fixing a long-standing UNIX misdesign.

This patch adds implicit and explicit pidfd support to sd-event: if a
process shall be watched and is specified by PID we will now internally
create a pidfd for it and use that, if available. Alternatively a new
constructor for child process event sources is added that takes pidfds
as input.

Besides mere watching of child processes via pidfd two additional
features are added:

→ sd_event_source_send_child_signal() allows sending a signal to the
  process being watched in the safest way possible (wrapping
  the new pidfd_send_signal() syscall).

→ sd_event_source_set_child_process_own() allows marking a process
  watched for destruction as soon as the event source is freed. This is
  currently implemented in userspace, but hopefully will become a kernel
  feature eventually.

Altogether this means an sd_event_source object is now a safe and stable
concept for referencing processes in race-free way, with automatic
fallback to pre-pidfd kernels.

Note that this patch adds support for this only to sd-event, not to PID
1. That's because PID 1 needs to use waitid(P_ALL) for reaping any
process that might get reparented to it. This currently semantically
conflicts with pidfd use for watching processes since we P_ALL is
undirected and thus might reap process earlier than the pidfd notifies
process end, which is hard to handle. The kernel will likely gain a
concept for excluding specific pidfds from P_ALL watching, as soon as
that is around we can start making use of this in PID 1 too.