]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agonetwork: move CAN link related functions to networkd-can.c
Yu Watanabe [Thu, 9 May 2019 06:39:19 +0000 (15:39 +0900)] 
network: move CAN link related functions to networkd-can.c

4 years agonetwork: make BindCarrier= work with CAN devices
Yu Watanabe [Fri, 10 May 2019 21:21:40 +0000 (06:21 +0900)] 
network: make BindCarrier= work with CAN devices

If CAN device is set `BindCarrier=` then the interface could not be
down. This fixes the issue.

4 years agonetwork: make link_drop() can take custom handler
Yu Watanabe [Thu, 9 May 2019 06:53:01 +0000 (15:53 +0900)] 
network: make link_drop() can take custom handler

It will be used in the later commit.

4 years agonetwork: move sd_lldp related functions to networkd-lldp-rx.c
Yu Watanabe [Thu, 9 May 2019 05:21:55 +0000 (07:21 +0200)] 
network: move sd_lldp related functions to networkd-lldp-rx.c

4 years agoLLDP: Fix logs for LLDP
Susant Sahani [Fri, 10 May 2019 12:17:45 +0000 (17:47 +0530)] 
LLDP: Fix logs for LLDP

```
May 10 11:08:54 test systemd-networkd[447]: wwan0: Failed to stop LLDP: Success
May 10 11:08:54 test systemd-networkd[447]: wwan0: Gained carrier
May 10 11:08:54 test systemd-networkd[447]: wwan0: Failed to start LLDP: Success
```

4 years agonetwork: move link_lldp_emit_enabled() to networkd-lldp-tx.c
Yu Watanabe [Thu, 9 May 2019 05:21:06 +0000 (07:21 +0200)] 
network: move link_lldp_emit_enabled() to networkd-lldp-tx.c

4 years agoMerge pull request #12518 from keszybz/naming-scheme
Lennart Poettering [Fri, 10 May 2019 19:14:59 +0000 (15:14 -0400)] 
Merge pull request #12518 from keszybz/naming-scheme

Document our naming schemes properly

4 years agonetworkd: VXLAN support keyword 'inherit' for TTL
Susant Sahani [Fri, 10 May 2019 12:05:24 +0000 (17:35 +0530)] 
networkd: VXLAN support keyword 'inherit' for TTL

4 years agoMerge pull request #12520 from ssahani/geneve
Yu Watanabe [Fri, 10 May 2019 17:47:19 +0000 (19:47 +0200)] 
Merge pull request #12520 from ssahani/geneve

networkd: Geneve add DF feature and allow TTL to bechosen by kernel

4 years agoMerge pull request #12526 from keszybz/some-trivial-follow-ups-for-the-varlink-pr
Lennart Poettering [Fri, 10 May 2019 17:29:58 +0000 (13:29 -0400)] 
Merge pull request #12526 from keszybz/some-trivial-follow-ups-for-the-varlink-pr

Some trivial follow ups for the varlink PR

4 years agojournalctl: improve error messages 12526/head
Zbigniew Jędrzejewski-Szmek [Fri, 10 May 2019 07:57:59 +0000 (09:57 +0200)] 
journalctl: improve error messages

Follow-up for #12230.

4 years agoUse sd_event_source_disable_unref()
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 12:47:32 +0000 (14:47 +0200)] 
Use sd_event_source_disable_unref()

4 years agosd-event: add sd_event_source_disable_unrefp() too
Zbigniew Jędrzejewski-Szmek [Fri, 10 May 2019 07:54:10 +0000 (09:54 +0200)] 
sd-event: add sd_event_source_disable_unrefp() too

I do not have any immediate use for it, but let's add it for completeness.

4 years agosd-event: add sd_event_source_disable_unref() helper
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 12:39:57 +0000 (14:39 +0200)] 
sd-event: add sd_event_source_disable_unref() helper

4 years agoMerge pull request #12521 from mrc0mmand/test-functions-tweaks-for-sanitizers
Evgeny Vereshchagin [Fri, 10 May 2019 14:17:23 +0000 (17:17 +0300)] 
Merge pull request #12521 from mrc0mmand/test-functions-tweaks-for-sanitizers

test: don't preload libasan for systemd-remount-fs.service

4 years agonetworkd: Geneve Allow TTL to be zero. 12520/head
Susant Sahani [Fri, 10 May 2019 09:41:47 +0000 (15:11 +0530)] 
networkd: Geneve Allow TTL to be zero.

Also verify VNI is set

4 years agonetworkd: Geneve add support configure IP don't fragment
Susant Sahani [Thu, 9 May 2019 16:07:46 +0000 (21:37 +0530)] 
networkd: Geneve add support configure IP don't fragment

4 years agosd-netlink: Add supprt for geneve properties
Susant Sahani [Thu, 9 May 2019 16:06:35 +0000 (21:36 +0530)] 
sd-netlink: Add supprt for geneve properties

IFLA_GENEVE_TTL_INHERIT and
IFLA_GENEVE_DF

4 years agoMerge pull request #12480 from ssahani/proxy-arp
Yu Watanabe [Fri, 10 May 2019 13:30:41 +0000 (15:30 +0200)] 
Merge pull request #12480 from ssahani/proxy-arp

network: bridge add support to configure proxy ARP/WIFI

4 years agonetworkd: Add support for blacklisting servers
Susant Sahani [Tue, 30 Apr 2019 22:47:41 +0000 (04:17 +0530)] 
networkd: Add support for blacklisting servers

closes #6260

fuzzer: Add DHCP support for blacklisting servers

4 years agoudev: drop "en" prefix from ID_NET_NAME_ONBOARD 12518/head
Zbigniew Jędrzejewski-Szmek [Thu, 9 May 2019 10:41:52 +0000 (12:41 +0200)] 
udev: drop "en" prefix from ID_NET_NAME_ONBOARD

The comment in udev-builtin-net_id.c (removed in grandparent commit) showed the
property without the prefix. I assume that was always the intent, because it
doesn't make much sense to concatenate anything to an arbitrary user-specified
field.

4 years agoudev: fix various comments
Zbigniew Jędrzejewski-Szmek [Thu, 9 May 2019 10:35:20 +0000 (12:35 +0200)] 
udev: fix various comments

In particular: "re-renaming" was just a copy-paste error.

4 years agoman: describe naming schemes in a new man page
Zbigniew Jędrzejewski-Szmek [Thu, 9 May 2019 10:34:30 +0000 (12:34 +0200)] 
man: describe naming schemes in a new man page

I decided to make this a separate man page because it is freakin' long.
This content could equally well go in systemd-udevd.service(8), systemd.link(5),
or a new man page for the net_id builtin.

v2:
- rename to systemd.net-naming-scheme
- add udevadm test-builtin net_id example

4 years agotest-alloc-util: add "test" that cleanup functions are done in expected order
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 11:34:41 +0000 (13:34 +0200)] 
test-alloc-util: add "test" that cleanup functions are done in expected order

4 years agoMerge pull request #12230 from poettering/varlink-minimal
Zbigniew Jędrzejewski-Szmek [Fri, 10 May 2019 07:40:49 +0000 (09:40 +0200)] 
Merge pull request #12230 from poettering/varlink-minimal

add simple varlink implementation + allow to move journald logging back from /var to /run

4 years agonetworkd: Log error if LLDP fails to start/stop
Susant Sahani [Thu, 9 May 2019 18:24:29 +0000 (23:54 +0530)] 
networkd: Log error if LLDP fails to start/stop

Now LLDP does not log anything why it failed which
is hard to debug. Let's just add some logs.

https://github.com/systemd/systemd/issues/10881

4 years agopo: minor fixes to Italian translation (#12500)
Daniele Medri [Thu, 9 May 2019 18:50:18 +0000 (20:50 +0200)] 
po: minor fixes to Italian translation (#12500)

4 years agoupdate TODO 12230/head
Lennart Poettering [Fri, 12 Apr 2019 12:13:17 +0000 (14:13 +0200)] 
update TODO

4 years agoman: document the two new journalctl commands
Lennart Poettering [Fri, 5 Apr 2019 16:59:25 +0000 (18:59 +0200)] 
man: document the two new journalctl commands

4 years agounits: automatically revert to /run logging on shutdown if necessary
Lennart Poettering [Fri, 5 Apr 2019 16:22:31 +0000 (18:22 +0200)] 
units: automatically revert to /run logging on shutdown if necessary

Fixes: #867
4 years agojournalctl: add new --relinquish and --smart-relinquish options
Lennart Poettering [Fri, 5 Apr 2019 16:21:02 +0000 (18:21 +0200)] 
journalctl: add new --relinquish and --smart-relinquish options

The latter is identical to the former, but becomes a NOP if
/var/log/journal is on the same mount as /, and thus during shutdown
unmounting /var is not necessary and hence we can keep logging until the
very end.

4 years agojournald: add API to move logging from /var to /run again
Lennart Poettering [Fri, 5 Apr 2019 16:20:25 +0000 (18:20 +0200)] 
journald: add API to move logging from /var to /run again

We now have this nice little Varlink API, let's beef it up a bit.

4 years agojournalctl: port --flush/--sync/--rotate to use varlink method calls
Lennart Poettering [Thu, 4 Apr 2019 17:41:33 +0000 (19:41 +0200)] 
journalctl: port --flush/--sync/--rotate to use varlink method calls

4 years agojournald: also offer flush/rotate/sync as varlink method calls
Lennart Poettering [Thu, 4 Apr 2019 17:38:18 +0000 (19:38 +0200)] 
journald: also offer flush/rotate/sync as varlink method calls

This makes the operations previously available via asynchronous signals
also available as regular varlink method calls, i.e. with sane
completion.

4 years agofuzzer: add varlink fuzzer
Lennart Poettering [Thu, 11 Apr 2019 16:42:37 +0000 (18:42 +0200)] 
fuzzer: add varlink fuzzer

4 years agotests: add varlink test
Lennart Poettering [Thu, 11 Apr 2019 16:47:10 +0000 (18:47 +0200)] 
tests: add varlink test

4 years agoshared: add minimal varlink implementation
Lennart Poettering [Thu, 11 Apr 2019 16:46:54 +0000 (18:46 +0200)] 
shared: add minimal varlink implementation

This adds a minimal Varlink (https://varlink.org/) implementation to our
tree. Given that we already have a JSON logic it's an easy thing to add.

Why bother?

We currently have major problems with IPC before dbus-daemon is up, and
in all components that dbus-daemon itself makes use of (such as various
NSS modules to resolve users as well as the journal which dbus-daemon
logs to). Because of that we so far ended up creating various (usually
crappy) work-arounds either coming up with secondary IPC systems or
sharing data statelessly in /run or similar. Let's clean this up, and
instead use a clean, well-defined, broker-less IPC for cases like that.

This is a minimal implementation of Varlink, i.e. the most basic logic
only. Stuff that's missing is left out on purpose: there's no
introspection/validation and there's no name service. It might make
sense to add that later, but for now let's only do the minimum buy-in we
can get away with. In particular as I'd assume that at least initially
we only use this IPC for our internal communication avoiding
introspection and the name service should be fine.

Specifically, I'd expect that we add IPC interfaces to the following
concepts with this scheme:

1. nss-resolve (so that hostname lookups with resolved work before
   resolved is up)
2. journald (so that IPC calls to journald don't have to go through
   dbus-daemon thus creating a cyclic dependency between journald and
   dbus-daemon)
3. nss-systemd (so that dynamic user lookups via PID 1 work sanely even
   inside of dbus-daemon, because otherwise we'd want to use dbus to run
   dbus which causes deadlocks)
4. networkd (to make sure one can talk to it in the initrd already,
   long before dbus is around)

And there might be other cases similar to this.

4 years agotest: allow SKIP_INITRD override 12521/head
Frantisek Sumsal [Thu, 9 May 2019 17:30:13 +0000 (19:30 +0200)] 
test: allow SKIP_INITRD override

Certain distributions (e.g. Arch Linux) require booting with initrd, as
they lack support for commonly used filesystems in the kernel (i.e. the
support is compiled in as modules)

4 years agotest: don't preload libasan for systemd-remount-fs.service
Frantisek Sumsal [Thu, 9 May 2019 17:20:34 +0000 (19:20 +0200)] 
test: don't preload libasan for systemd-remount-fs.service

The `mount` utility has an unexpected behavior when run with libasan,
causing false-positives during the integration testing.

For example, on Arch Linux with LD_PRELOAD pointing to libasan:
```
bash-5.0# mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
1
```
However:
```
bash-5.0# LD_PRELOAD= mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
0
```
Further investigation with strace shows a LeakSanitizer error:
```
bash-5.0# strace -s 512 mount -o remount,rw -v /
...
write(2, "==355==LeakSanitizer has encountered a fatal error.\n", 52) = -1 EBADF (Bad file descriptor)
write(2, "ReportFile::Write() can't output requested buffer!\n", 51) = -1 EBADF (Bad file descriptor)
exit_group(1)                           = ?
+++ exited with 1 +++
```

Let's workaround this by clearing the LD_PRELOAD variable for
systemd-remount-fs.service

4 years agoman: merge items specified as separate lists into one list
Zbigniew Jędrzejewski-Szmek [Thu, 9 May 2019 06:12:03 +0000 (08:12 +0200)] 
man: merge items specified as separate lists into one list

4 years agoMerge pull request #12513 from ssahani/vxlan
Yu Watanabe [Thu, 9 May 2019 09:26:43 +0000 (11:26 +0200)] 
Merge pull request #12513 from ssahani/vxlan

networkd: Allow users to set the IPv4 DF bit in outgoing packets

4 years agonetwork: add support to configure proxy ARP/WIFI 12480/head
Susant Sahani [Thu, 9 May 2019 00:32:12 +0000 (02:32 +0200)] 
network: add support to configure proxy ARP/WIFI

4 years agonetworkd: VXLAN add support to configure IP Don't fragment. 12513/head
Susant Sahani [Wed, 8 May 2019 17:01:08 +0000 (22:31 +0530)] 
networkd: VXLAN add support to configure IP Don't fragment.

Allow users to set the IPv4 DF bit in outgoing packets, or to inherit its
value from the IPv4 inner header. If the encapsulated protocol is IPv6 and
DF is configured to be inherited, always set it.

4 years agosd-netlink: Add VXLAN netlink properties
Susant Sahani [Wed, 8 May 2019 16:59:40 +0000 (22:29 +0530)] 
sd-netlink: Add VXLAN netlink properties

Add IFLA_VXLAN_DF and IFLA_VXLAN_TTL_INHERIT

4 years agonetworkd: Assign VXLAN destination port to when GPE is set
Susant Sahani [Wed, 8 May 2019 14:39:42 +0000 (20:09 +0530)] 
networkd: Assign VXLAN destination port to when GPE is set

When VXLAN destination port is unset and GPE is set
then assign 4790 to destination port. Kernel does the same as
well as iproute.

IANA VXLAN-GPE port is 4790

4 years agonetworkd: fix link_up() (#12505)
Susant Sahani [Thu, 9 May 2019 02:05:35 +0000 (07:35 +0530)] 
networkd: fix link_up() (#12505)

Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up.

Fixes the following error:
```
dummy-test: Could not bring up interface: Invalid argument
```

After reading the kernel code when we do a link up
```
net/core/rtnetlink.c
IFLA_AF_SPEC
 af_ops->set_link_af(dev, af);
  inet6_set_link_af
   if (tb[IFLA_INET6_ADDR_GEN_MODE])
             Here it looks for IFLA_INET6_ADDR_GEN_MODE
```
Since link up we didn't filling up that it's failing.

Closes #12504.

4 years agonetwork: include glibc headers before including kernel headers
Yu Watanabe [Thu, 9 May 2019 00:33:45 +0000 (02:33 +0200)] 
network: include glibc headers before including kernel headers

4 years agonetwork: drop arpa/inet.h from networkd-manager.h
Yu Watanabe [Thu, 9 May 2019 00:33:33 +0000 (02:33 +0200)] 
network: drop arpa/inet.h from networkd-manager.h

4 years agosd-netlink: include glibc headers earlier to resolve conflict with kernel headers
Yu Watanabe [Thu, 9 May 2019 00:27:24 +0000 (02:27 +0200)] 
sd-netlink: include glibc headers earlier to resolve conflict with kernel headers

Then, hopefully libc-compat.h make everything fine.

4 years agonetwork: replace inet_pton() with in_addr_from_string()
Yu Watanabe [Wed, 8 May 2019 22:14:06 +0000 (00:14 +0200)] 
network: replace inet_pton() with in_addr_from_string()

4 years agonetwork: replace inet_ntop() with in_addr_to_string()
Yu Watanabe [Wed, 8 May 2019 22:03:54 +0000 (00:03 +0200)] 
network: replace inet_ntop() with in_addr_to_string()

4 years agonetworkd: Add support to configure proxy ARP and proxy ARP Wifi
Susant Sahani [Sat, 4 May 2019 14:51:13 +0000 (20:21 +0530)] 
networkd: Add support to configure proxy ARP and proxy ARP Wifi

4 years agoMerge pull request #12445 from cdown/dmm_docs
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 16:09:45 +0000 (18:09 +0200)] 
Merge pull request #12445 from cdown/dmm_docs

cgroup: Some memory protection fixes

4 years agoMerge pull request #12411 from keszybz/pr/12394
Lennart Poettering [Wed, 8 May 2019 14:11:32 +0000 (10:11 -0400)] 
Merge pull request #12411 from keszybz/pr/12394

run: when emitting the calendarspec warning, use red

4 years agoMerge pull request #12509 from poettering/table-fixlets
Lennart Poettering [Wed, 8 May 2019 14:10:55 +0000 (10:10 -0400)] 
Merge pull request #12509 from poettering/table-fixlets

two trivial fixes to table formatting code

4 years agoutil-lib: fix a typo in rdrand
Evgeny Vereshchagin [Wed, 8 May 2019 13:50:53 +0000 (15:50 +0200)] 
util-lib: fix a typo in rdrand

Otherwise, the fuzzers will fail to compile with MSan:
```
../../src/systemd/src/basic/random-util.c:64:40: error: use of undeclared identifier 'sucess'; did you mean 'success'?
        msan_unpoison(&success, sizeof(sucess));
                                       ^~~~~~
                                       success
../../src/systemd/src/basic/alloc-util.h:169:50: note: expanded from macro 'msan_unpoison'
                                                 ^
../../src/systemd/src/basic/random-util.c:38:17: note: 'success' declared here
        uint8_t success;
                ^
1 error generated.
[80/545] Compiling C object 'src/basic/a6ba3eb@@basic@sta/process-util.c.o'.
ninja: build stopped: subcommand failed.
Fuzzers build failed
```

4 years agocgroup: Test that it's possible to set memory protection to 0 again 12445/head
Chris Down [Fri, 3 May 2019 12:40:11 +0000 (08:40 -0400)] 
cgroup: Test that it's possible to set memory protection to 0 again

The previous commit fixes this up, and this should prevent it
regressing.

4 years agocgroup: Support 0-value for memory protection directives
Chris Down [Fri, 3 May 2019 12:32:41 +0000 (08:32 -0400)] 
cgroup: Support 0-value for memory protection directives

These make sense to be explicitly set at 0 (which has a different effect
than the default, since it can affect processing of `DefaultMemoryXXX`).

Without this, it's not easily possible to relinquish memory protection
for a subtree, which is not great.

4 years agocgroup: Readd some plumbing for DefaultMemoryMin
Chris Down [Fri, 3 May 2019 12:19:05 +0000 (08:19 -0400)] 
cgroup: Readd some plumbing for DefaultMemoryMin

Somehow these got lost in the previous PR, rendering DefaultMemoryMin
not very useful.

4 years agocgroup: Polish hierarchically aware protection docs a bit
Chris Down [Tue, 30 Apr 2019 18:22:04 +0000 (14:22 -0400)] 
cgroup: Polish hierarchically aware protection docs a bit

I missed adding a section in `systemd.resource-control` about
DefaultMemoryMin in #12332.

Also, add a NEWS entry going over the general concept.

4 years agoMerge pull request #11887 from evverx/fuzzbuzz
Lennart Poettering [Wed, 8 May 2019 10:40:03 +0000 (12:40 +0200)] 
Merge pull request #11887 from evverx/fuzzbuzz

tests: hook up fuzz targets to FuzzBuzz

4 years agomachinectl/loginctl: show json output if requested even if zero entries 12509/head
Lennart Poettering [Mon, 6 May 2019 23:21:24 +0000 (01:21 +0200)] 
machinectl/loginctl: show json output if requested even if zero entries

4 years agoformat-table: correct prototype
Lennart Poettering [Mon, 6 May 2019 23:20:49 +0000 (01:20 +0200)] 
format-table: correct prototype

4 years agoMerge pull request #12489 from ssahani/vxlan
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 10:02:54 +0000 (12:02 +0200)] 
Merge pull request #12489 from ssahani/vxlan

networkd: VXLAN rename Id to VNI

4 years agoMerge pull request #12507 from poettering/random-fixlets
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 10:02:02 +0000 (12:02 +0200)] 
Merge pull request #12507 from poettering/random-fixlets

three minor fixes to random-util.c

4 years agojournalctl,shared/log: use yellow for warnings 12411/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 15:42:46 +0000 (17:42 +0200)] 
journalctl,shared/log: use yellow for warnings

In program output, highlighting warnings with ANSI_HIGHLIGHT is not enough,
because it doesn't stand out enough. Yellow is more appropriate.

I was worried that yellow wouldn't be visible on white background, but (at
least gnome-terminal) uses a fairly dark yellow that is fully legible on white
and light-colored backgrounds. We also used yellow in many places,
e.g. systemctl, so this should be fine.

Note: yellow is unreadable on urxvt with white background (urxvt +rv). But
grey, which we already used, is also unreadable, so urxvt users would have
to disable colors anyway, so this change does not make the problem
intrinsically worse. See
https://github.com/systemd/systemd/issues/12482#issuecomment-490374210.

4 years agoEnable log colors for most of tools in /usr/bin
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 10:28:25 +0000 (12:28 +0200)] 
Enable log colors for most of tools in /usr/bin

When emitting the calendarspec warning we want to see some color.
Follow-up for 04220fda5c.

Exceptions:
- systemctl, because it has a lot hand-crafted coloring
- tmpfiles, sysusers, stdio-bridge, etc, because they are also used in
  services and I'm not sure if this wouldn't mess up something.

4 years agobasic/log: use colors to highlight messages like journalctl
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 10:27:33 +0000 (12:27 +0200)] 
basic/log: use colors to highlight messages like journalctl

4 years agonetworkd: bridge fdb add support to configure VXLAN VNI
Susant Sahani [Mon, 6 May 2019 14:28:52 +0000 (19:58 +0530)] 
networkd: bridge fdb add support to configure VXLAN VNI

4 years agofuzz: fix spelling of MACsec and MACAddress in the corpus 12489/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 18:33:38 +0000 (20:33 +0200)] 
fuzz: fix spelling of MACsec and MACAddress in the corpus

4 years agocheck-directives: use diff to show what the differences really are
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 18:31:32 +0000 (20:31 +0200)] 
check-directives: use diff to show what the differences really are

This also makes the comparison more detailed, since we check spelling,
including case.

4 years agonetworkd: VXLAN use correct type for VNI
Susant Sahani [Tue, 7 May 2019 09:15:30 +0000 (14:45 +0530)] 
networkd: VXLAN use correct type for VNI

4 years agonetworkd: VXLAN add support to configure Generic Protocol Extension
Susant Sahani [Mon, 6 May 2019 19:10:57 +0000 (00:40 +0530)] 
networkd: VXLAN add support to configure Generic Protocol Extension

See https://tools.ietf.org/html/draft-ietf-nvo3-vxlan-gpe-07

4 years agoMerge pull request #12501 from keszybz/silence-strncpy-warnings
Lennart Poettering [Tue, 7 May 2019 23:39:32 +0000 (01:39 +0200)] 
Merge pull request #12501 from keszybz/silence-strncpy-warnings

Silence strncpy warnings

4 years agorandom-util: rename "err" to "success" 12507/head
Lennart Poettering [Tue, 7 May 2019 22:51:26 +0000 (18:51 -0400)] 
random-util: rename "err" to "success"

After all rdrand returns 1 on success, and 0 on failure, hence let's
name this accordingly.

4 years agotravis: make sure that the fuzz targets can be built on OSS-Fuzz 11887/head
Evgeny Vereshchagin [Sun, 5 May 2019 22:15:28 +0000 (22:15 +0000)] 
travis: make sure that the fuzz targets can be built on OSS-Fuzz

4 years agotravis: make sure the fuzz targets can be built on FuzzBuzz
Evgeny Vereshchagin [Sun, 5 May 2019 20:00:38 +0000 (20:00 +0000)] 
travis: make sure the fuzz targets can be built on FuzzBuzz

4 years agotests: hook up fuzz targets to FuzzBuzz
Evgeny Vereshchagin [Sun, 5 May 2019 19:28:42 +0000 (19:28 +0000)] 
tests: hook up fuzz targets to FuzzBuzz

4 years agorandom-util: hash AT_RANDOM getauxval() value before using it
Lennart Poettering [Tue, 7 May 2019 21:26:55 +0000 (17:26 -0400)] 
random-util: hash AT_RANDOM getauxval() value before using it

Let's be a bit paranoid and hash the 16 bytes we get from getauxval()
before using them. AFter all they might be used by other stuff too (in
particular ASLR), and we probably shouldn't end up leaking that seed
though our crappy pseudo-random numbers.

4 years agorandom-util: use gcc's bit_RDRND definition if it exists
Lennart Poettering [Tue, 7 May 2019 20:21:44 +0000 (16:21 -0400)] 
random-util: use gcc's bit_RDRND definition if it exists

4 years agorandom-util: rename RANDOM_DONT_DRAIN → RANDOM_MAY_FAIL
Lennart Poettering [Tue, 7 May 2019 20:18:13 +0000 (16:18 -0400)] 
random-util: rename RANDOM_DONT_DRAIN → RANDOM_MAY_FAIL

The old flag name was a bit of a misnomer, as /dev/urandom cannot be
"drained". Once it's initialized it's initialized and then is good
forever. (Only /dev/random has a concept of 'draining', but we never use
that, as it's an obsolete interface).

The flag is still useful though, since it allows us to suppress accesses
to the random pool while it is not initialized, as that trips up the
kernel and it logs about any such attempts, which we really don't want.

4 years agoscsi_serial: replace some crazy strncpy() calls by strnlen() 12501/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 13:58:29 +0000 (15:58 +0200)] 
scsi_serial: replace some crazy strncpy() calls by strnlen()

gcc was warning about strncpy() leaving an unterminated string.
In this case, it was correct.

The code was doing strncpy()+strncat()+strlen() essentially to determine
if the strings have expected length. If the length was correct, a buffer
overread was performed (or at least some garbage bytes were used from the
uninitialized part of the buffer). Let's do the length check first and then
only copy stuff if everything agrees.

For some reason the function was called "prepend", when it obviously does
an "append".

4 years agoshared/utmp-wtmp: silence gcc warning about strncpy truncation
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 13:10:58 +0000 (15:10 +0200)] 
shared/utmp-wtmp: silence gcc warning about strncpy truncation

Unfortunately the warning must be known, or otherwise the pragma generates a
warning or an error. So let's do a meson check for it.

Is it worth doing this to silence the warning? I think so, because apparently
the warning was already emitted by gcc-8.1, and with the recent push in gcc to
catch more such cases, we'll most likely only get more of those.

4 years agonetworkd: VXLan TTL must be <= 255
Susant Sahani [Mon, 6 May 2019 17:37:32 +0000 (23:07 +0530)] 
networkd: VXLan TTL must be <= 255

Ignore when TTL > 255

4 years agonetworkd: VXLan Make group and remote variable separate
Susant Sahani [Tue, 7 May 2019 05:14:06 +0000 (10:44 +0530)] 
networkd: VXLan Make group and remote variable separate

VXLAN Document Group=

4 years agoMerge pull request #12475 from yuwata/network-fix-12452
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 18:03:22 +0000 (20:03 +0200)] 
Merge pull request #12475 from yuwata/network-fix-12452

network: add network_ref/_unref() and make Link object take a reference of Network object

4 years agoMerge pull request #12481 from ssahani/dhcp-max-retry
Zbigniew Jędrzejewski-Szmek [Tue, 7 May 2019 17:58:40 +0000 (19:58 +0200)] 
Merge pull request #12481 from ssahani/dhcp-max-retry

networkd: Allow DHCP4 client to set the number to attempt to configure/reconfigure

4 years agonetworkd: VXLAN rename Id to VNI
Susant Sahani [Tue, 7 May 2019 05:01:22 +0000 (10:31 +0530)] 
networkd: VXLAN rename Id to VNI

It makes more sense to call VXLAN ID as

1. the VXLAN Network Identifier (VNI) (or VXLAN Segment ID)
2. test-network: rename VXLAN Id to VNI
3. fuzzer: Add VXLAN VNI directive to fuzzer

4 years agonetworkd: VXLAN ID define range in the man
Susant Sahani [Mon, 6 May 2019 11:58:48 +0000 (17:28 +0530)] 
networkd: VXLAN ID define range in the man

4 years agotest-network: add one more test for LinkLocalAddressing=fallback 12481/head
Yu Watanabe [Sun, 5 May 2019 15:42:05 +0000 (17:42 +0200)] 
test-network: add one more test for LinkLocalAddressing=fallback

4 years agonetwork: add error cause in the log
Yu Watanabe [Tue, 7 May 2019 13:54:15 +0000 (15:54 +0200)] 
network: add error cause in the log

4 years agonetworkd: Allow DHCP4 client to set the number to attempt to reconfigure.
Susant Sahani [Sat, 4 May 2019 11:40:54 +0000 (17:10 +0530)] 
networkd: Allow DHCP4 client to set the number to attempt to reconfigure.

Otherwise current value is 6 and after 6 it will give up.

4 years agonetwork: use IN_ADDR_NULL and ETHER_ADDR_NULL 12475/head
Yu Watanabe [Sat, 4 May 2019 18:14:08 +0000 (20:14 +0200)] 
network: use IN_ADDR_NULL and ETHER_ADDR_NULL

The change in manager_rtnl_process_address() may not be necessary,
but for safety, let's initialize the value.

4 years agonetwork: fix conditional jump depends on uninitialised value(s)
Yu Watanabe [Sat, 4 May 2019 18:03:44 +0000 (20:03 +0200)] 
network: fix conditional jump depends on uninitialised value(s)

When address is in IPv4, the remaining buffer in in_addr_union may
not be initialized.

Fixes the following valgrind warning:
```
==13169== Conditional jump or move depends on uninitialised value(s)
==13169==    at 0x137FF6: UnknownInlinedFun (networkd-ndisc.c:77)
==13169==    by 0x137FF6: UnknownInlinedFun (networkd-ndisc.c:580)
==13169==    by 0x137FF6: ndisc_handler.lto_priv.83 (networkd-ndisc.c:597)
==13169==    by 0x11BE23: UnknownInlinedFun (sd-ndisc.c:201)
==13169==    by 0x11BE23: ndisc_recv.lto_priv.174 (sd-ndisc.c:254)
==13169==    by 0x4AA18CF: source_dispatch (sd-event.c:2821)
==13169==    by 0x4AA1BC2: sd_event_dispatch (sd-event.c:3234)
==13169==    by 0x4AA1D88: sd_event_run (sd-event.c:3291)
==13169==    by 0x4AA1FAB: sd_event_loop (sd-event.c:3313)
==13169==    by 0x117401: UnknownInlinedFun (networkd.c:113)
==13169==    by 0x117401: main (networkd.c:120)
==13169==  Uninitialised value was created by a stack allocation
==13169==    at 0x1753C8: manager_rtnl_process_address (networkd-manager.c:479)
```

4 years agosd-radv: fix memleak
Yu Watanabe [Sat, 4 May 2019 16:08:23 +0000 (18:08 +0200)] 
sd-radv: fix memleak

Fixes one memleak found in #12452.

4 years agonetwork: fix use-after-free
Yu Watanabe [Sat, 4 May 2019 17:43:45 +0000 (19:43 +0200)] 
network: fix use-after-free

The function sd_radv_add_prefix() in dhcp6_pd_prefix_assign() may
return -EEXIST, and in that case the sd_radv_prefix object allocated
in dhcp6_pd_prefix_assign() will be freed when the function returns.
Hence, the key value in Manager::dhcp6_prefixes hashmap is lost.

4 years agonetwork: fix memleak and double free
Yu Watanabe [Sat, 4 May 2019 13:59:36 +0000 (15:59 +0200)] 
network: fix memleak and double free

Fixes the third issue in #12452.

4 years agonetwork: simplify link_free()
Yu Watanabe [Sat, 4 May 2019 13:33:17 +0000 (15:33 +0200)] 
network: simplify link_free()

4 years agonetwork: drop list fields in Network object
Yu Watanabe [Sat, 4 May 2019 11:02:18 +0000 (13:02 +0200)] 
network: drop list fields in Network object

4 years agonetworkd: manager do not unef netlink and gennetlink early
Susant Sahani [Thu, 2 May 2019 09:52:03 +0000 (15:22 +0530)] 
networkd: manager do not unef netlink and gennetlink early

Because of this the fd is getting closed and we getting errors
like
```
^Ceno1: Could not send rtnetlink message: Bad file descriptor
enp7s0f0: Could not send rtnetlink message: Bad file descriptor
enp7s0f0: Cannot delete unreachable route for DHCPv6 delegated subnet 2a0a:...:fc::/62: Bad file descriptor
Assertion '*_head == _item' failed at ../systemd/src/network/networkd-route.c:126, function route_free(). Aborting.
Aborted
```

Closes one of https://github.com/systemd/systemd/issues/12452