Commit graph

11210 commits

Author SHA1 Message Date
Thomas Haller
66cbca1f21 platform/tests: fix assertion for unit test for address lifetime
Sometimes the test fail:

    $ make -j 10 src/platform/tests/test-address-linux
    $ while true; do
          NMTST_DEBUG=d ./tools/run-nm-test.sh src/platform/tests/test-address-linux 2>&1 > log.txt || break;
      done

fails with:

    ERROR: src/platform/tests/test-address-linux - Bail out! test:ERROR:src/platform/tests/test-common.c:790:nmtstp_ip_address_assert_lifetime: assertion failed (adr <= lft): (1001 <= 1000)

That is, because of a wrong check. Fix it.

(cherry picked from commit e180464bcc)
2018-11-28 16:17:33 +01:00
Beniamino Galvani
05c27c3c50 lldp: fix parsing of vlan-name attribute
We used to read 3 bytes after the TLV, fix this.

Also, check that string length is at most 32 bytes as specified in
figure E.3 of IEEE 802.1AB-2009.

Fixes: 18133ea142

https://bugzilla.redhat.com/show_bug.cgi?id=1652210
(cherry picked from commit e909778710)
2018-11-22 09:43:18 +01:00
Lubomir Rintel
379eff21ed dhcp: drop unused variable
src/dhcp/nm-dhcp-client.c:552:16: error: unused variable 'str' [-Werror,-Wunused-variable]
        gs_free char *str = NULL;
                      ^

Fixes: 787f4b57cd
(cherry picked from commit 6f111b3d2e)
2018-11-22 07:37:32 +01:00
Benjamin Berg
bbef6cf44a systemd: fix crash by unrefing event sources before re-adding them
In certain cases the timeouts may not have been unref'ed before they
need to be re-added. Add the appropriate unref calls to ensure we don't
register the timeout multiple times.

This fixes possible cases where timeouts are triggered multiple times
and even on destroyed DHCPv6 clients.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/73

(cherry picked from commit e179202e47)
2018-11-15 14:51:05 +01:00
Thomas Haller
aa7acb0ae3 build: avoid header conflict for <linux/if.h> and <net/if.h> with "nm-platform.h"
In the past, the headers "linux/if.h" and "net/if.h" were incompatible.
That means, we can either include one or the other, but not both.
This is fixed in the meantime, however the issue still exists when
building against older kernel/glibc.

That means, including one of these headers from a header file
is problematic. In particular if it's a header like "nm-platform.h",
which itself is dragged in by many other headers.

Avoid that by not including these headers from "platform.h", but instead
from the source files where needed (or possibly from less popular header
files).

Currently there is no problem. However, this allows an unknowing user to
include <net/if.h> at the same time with "nm-platform.h", which is easy
to get wrong.

(cherry picked from commit 37e47fbdab)
2018-11-14 14:39:10 +01:00
Thomas Haller
62a5ff605b dhcp: initialize hostname as construct-property
The hostname property is only initialized once, early on during
start. Move the initialization even earlier during object constructions.
This effectively makes the hostname an immutable property.

This also makes sense, because the hostname is used by IPv4 and
IPv6 DHCP instances alike.

(cherry picked from commit 787f4b57cd)
2018-11-14 14:18:06 +01:00
Thomas Haller
22ffd02f87 core/trivial: add code comment about DHCP client-id/DUID
(cherry picked from commit e9630e7d57)
2018-11-14 14:18:06 +01:00
Thomas Haller
525830a4a0 dhcp: add "ipv4.dhcp-client-id=duid" setting
Add a new mode for the DHCPv4 client identifier.

"duid" is what the internal (systemd) DHCP client already does by
default. It is also the same as used by systemd-networkd's
"ClientIdentifier=duid" setting. What we still lack (compared to
networkd) are a way to overwrite IAID and the DUID.

Previously, this mode was used by the internal DHCP plugin
by default. However, it could not be explicitly configured.
In general, our default values should also be explicitly selectable.
Now the "duid" client identifier can also be used with the "dhclient"
plugin.

(cherry picked from commit 8861ac2976)
2018-11-14 14:18:06 +01:00
Thomas Haller
cb50647144 dhcp: always require hwaddr in internal DHCP clint ip6_start()
Note how client_start() in NMDhcpManager already asserts
that we have a MAC address. It's always present, like
for the IPv6 case.

(cherry picked from commit dfdd4e3bd3)
2018-11-14 14:18:06 +01:00
Thomas Haller
f70e762a4f all: add "${MAC}" substituion for "connection.stable-id"
We already had "${DEVICE}" which uses the interface name.
In times of predictable interface naming, that works well.
It allows the user to generate IDs per device which don't
change when the hardware is replaced.

"${MAC}" is similar, except that is uses the permanent MAC
address of the device. The substitution results in the empty
word, if the device has no permanent MAC address (like software
devices).

The per-device substitutions "${DEVICE}" and "${MAC}" are especially
interesting with "connection.multi-connect=multiple".

(cherry picked from commit 7ffbf71276)
2018-11-14 14:18:06 +01:00
Thomas Haller
a31edf0b3e dhcp: cleanup error handling in internal DHCP client's start
- use nm_auto to return early when something goes wrong

- don't modify NMDhcpClient's state until the end, when it looks
  like we are (almost) started successfully.

- for IPv4, only attempt to load the lease if we actually are
  interested in the address. Also, reduce the scope of the lease
  variable, to the one place where we need it.

(cherry picked from commit ab314065b8)
2018-11-14 14:18:06 +01:00
Thomas Haller
b21652b8d0 dhcp: don't load IPv4 client-id from lease file
The client-id is something that we want to determine top-down.
Meaning, if the user specifies it via ipv4.dhcp-client-id, then it
should be used. If the user leaves it unspecified, we choose a
default stable client-id. For the internal DHCP plugin, this is
a node specific client-id based on

  - the predictable interface name
  - and /etc/machine-id

It's not clear, why we should allow specifying the client-id in
the lease file as a third source of configuration. It really pushes
the configuration first down (when we do DHCP without lease file),
to store an additional bit of configuration for future DHCP attempts.

If the machine-id or the interface-name changes, then so does the
default client-id. In this case, also "ipv4.dhcp-client-id=stable"
changes. It's fair to require that the user keeps the machine-id
stable, if the machine identity doesn't change.

Also, the lease files are stored in /var/lib/NetworkManager, which
is more volatile than /etc/machine-id. So, if we think that machine-id
and interface-name is not stable, why would we assume that we have
a suitable lease file?

Also, if you do:

   nmcli connection add con-name "$PROFILE" ... ipv4.dhcp-client-id ''
   nmcli connection up $PROFILE
   nmcli connection modify "$PROFILE" ipv4.dhcp-client-id mac
   nmcli connection up $PROFILE
   nmcli connection modify "$PROFILE" ipv4.dhcp-client-id ''
   nmcli connection up $PROFILE

wouldn't you expect that the original (default) client-id is used again?

Also, this works badly with global connection defaults in
NetworkManager.conf. If you configure a connection default, previously
already this would always force the client-id and overrule the lease.
That is reasonable, but in which case would you ever want to use
the client-id from the lease?

(cherry picked from commit 5b9bc174d1)
2018-11-14 14:18:06 +01:00
Thomas Haller
d54b444cb4 dhcp: cleanup initializing IPv4 client-id for internal DHCP
- if we leave the client-id of sd_dhcp_client unset, it will
  anyway generate a node-specific client-id (and may fail if
  "/etc/machine-id" is invalid).
  Anticipate that, and don't let the client-id unset. In case
  we have no client-id from configuration or lease, just generate
  the id ourself (using the same algorithm). The advantage is,
  that we know it upfront and can store the client-id in the
  NMDhcpClient instance. We no longer need to peel it out from
  the lease later.

- to generate the IPv4 client-id, we need a valid MAC address. Also,
  sd_dhcp_client needs a MAC address for dhcp_network_bind_raw_socket()
  as well. Just require that a MAC address is always needed. Likewise,
  we need a valid ifindex and ifname set.

- likewise for IPv6 and IPv4, cleanup detecting the arptype and
  checking MAC address length. sd_dhcp_client_set_mac() is overly
  strict at asserting input arguments, so we must validate them anyway.

- also, now that we always initialize the client-id when starting
  the DHCP client, there is no need to retroactively extract it
  again when we receive the first lease.

(cherry picked from commit c3e7e6170d)
2018-11-14 14:18:06 +01:00
Thomas Haller
71e3db4f56 dhcp/trivial: wrap lines in calling client_start()
A possible issue is that client_start() has about 136 arguments.
It doesn't get simpler by saving lines of code and writing them
all in the same line.

Wrap the lines.

While at it, use "FALSE" for "enforce_duid" argument, instead of "0".
It's a boolean.

(cherry picked from commit ce1cfd7232)
2018-11-14 14:18:06 +01:00
Thomas Haller
1fecb5ec9d dhcp: minor refactoring return paths in NMDhcpDhclient.get_duid()
(cherry picked from commit d6d2b7296f)
2018-11-14 14:18:06 +01:00
Thomas Haller
93eb69a0e9 dhcp: use cleanup attribute for get_dhclient_leasefile()
(cherry picked from commit b833d68d68)
2018-11-14 14:18:06 +01:00
Thomas Haller
cc0c056885 dhcp: don't pass duid to client ip6_start() and stop()
We don't do that for ip4_start() either. The duid/client-id
is stored inside the NMDhcpClient instance, and the function can
access it from there.

Maybe, it is often preferable to have stateless objects and not
relying on ip4_start() to obtain the client ID from the client's
state. However, the purpose of the NMDhcpClient object is to
hold state about DHCP. To simplify the complexity of objects that
inherrently have state, we should be careful about mutating the state.
It adds little additional complexity of only reading the state when
needed anyway. In fact, it adds complexity, because previously
it wasn't enough to check all callers of nm_dhcp_client_get_client_id()
to see where the client-id is used. Instead, one would also need to
follow the @duid argument several layers of the call stack.

(cherry picked from commit 7d55b1348b)
2018-11-14 14:18:06 +01:00
Thomas Haller
0e6c84e806 dhcp: refactor nm_dhcp_dhclient_save_duid() to accept original DUID
There should be lower layers that are concerned with writing
and reading dhclient configuration files. It's wrong to
have a nm_dhcp_dhclient_save_duid() function which requires
the caller to pre-escape the string to write. The caller shouldn't
be concerned with the file format, that's why the function
is used in the first place.

(cherry picked from commit cd9e418fbe)
2018-11-14 14:18:06 +01:00
Thomas Haller
d347c927cd dhcp: merge "duid" and "client_id" field in NMDhcpClient
We only used "client_id" for IPv4 and "duid" for IPv6. Merge them.

Another advantage is, that we can share the logging functionality
of _set_client_id().

(cherry picked from commit 7e341b73e0)
2018-11-14 14:18:06 +01:00
Thomas Haller
981a54024b dhcp: drop unused nm_dhcp_dhclient_get_client_id_from_config_file()
Drop unused function.

Aside from that, dhclient configuration files support a very complex
syntax. The parser was very naive and insufficient in parsing such
files. It's good we can just drop it.

(cherry picked from commit 025157d597)
2018-11-14 14:18:06 +01:00
Thomas Haller
a6095fd043 dhcp: don't re-read DHCP client ID from configuration file for dhclient
Why would we do this? The configuration file we are reading back was
written by NetworkManager in the first place.

Maybe when assuming a connection after restart, this information could
be interesting. It however is not actually relevant.

Note how nm_dhcp_client_get_client_id() has only very few callers.

  - nm_device_spawn_iface_helper() in 'nm-device.c'. In this case,
    we either should use the client-id which we used when starting
    DHCP, or none at all.

  - ip4_start() in 'nm-dhcp-dhclient.c', but this is before starting
    DHCP client and before it was re-read from configuration file.

  - in "src/dhcp/nm-dhcp-systemd.c", but this has no effect for
    the dhclient plugin.

(cherry picked from commit 5411fb0cc6)
2018-11-14 14:18:06 +01:00
Thomas Haller
3b8d882658 dhcp: reimplement node-specific DHCP client-id generation from systemd
Our internal DHCP client (from systemd) defaults to a particular client ID.
It is currently exposed as nm_sd_utils_generate_default_dhcp_client_id()
and is based on the systemd implementation.

One problem with that is, that it internally looks up the interface name
with if_indextoname() and reads /etc/machine-id. Both makes it harder
for testing.

Another problem is, that this way of generating the client-id is
currently limited to internal client. Why? If you use dhclient plugin,
you may still want to use the same algorithm. Also, there is no explict
"ipv4.dhcp-client-id" mode to select this client-id (so that it could
be used in combination with "dhclient" plugin).
As such, this code will be useful also aside systemd DHCP plugin.
Hence, the function should not be obviously tied to systemd code.

The implementation is simple enough, and since we already have a
unit-test, refactor the code to our own implementation.

(cherry picked from commit a55795772a)
2018-11-14 14:18:06 +01:00
Thomas Haller
13bf09fbd9 dhcp: test systemd's default DHCP client identifier generation
Internal DHCP client generates a default client ID. For one,
we should ensure that this algorithm does not change without
us noticing, for example, when upgrading systemd code. Add
a test, that the generation algorithm works as we expect.

Also note, that the generation algorithm uses siphash24().
That means, siphash24() implementation also must not change
in the future, to ensure the client ID doesn't change. As we
patch systemd sources to use shared/c-siphash, this is not
obviously the case. Luckily c-siphash and systemd's siphash24 do
agree, so all is good. The test is here to ensure that.

Also, previously the generation algorithm is not exposed as a
function, sd_dhcp_client will just generate a client-id when
it needs it. However, later we want to know (and set) the client
id before starting DHCP and not leave it unspecified to an
implementation detail.

This patch only adds a unit-test for the existing DHCP client
ID generation to have something for comparison. In the next
commit this will change further.

(cherry picked from commit 187d356198)
2018-11-14 14:18:06 +01:00
Thomas Haller
b04c033007 core: cleanup generating DUID in nm-device.c
- use NMUuid type where appropriate.

- no error handling for generate_duid_from_machine_id().
  It cannot fail anymore.

- add thread-safety to generate_duid_from_machine_id() with
  double-checked locking.

- use unions for converting the sha256 digest to the target
  type.

(cherry picked from commit 50121ee028)
2018-11-14 14:18:06 +01:00
Thomas Haller
10e280686e core: pass boot-id to nm_utils_stable_id_parse()
For testing purpose, it's bad to let nm_utils_stable_id_parse()
directly access nm_utils_get_boot_id_str(). Instead, the function
should have no side-effects.

Since the boot-id is anyway cached, accessing it is cheap. Even
if it likely won't be needed.

(cherry picked from commit c51e63feb6)
2018-11-14 14:18:05 +01:00
Thomas Haller
0c1ee8c68e core: don't persist secret-key for tests
Tests might access the secret-key.

For CI builds we may very well build NM as root and also run
unit tests. In such a situation it's bad to persist the secret
key. For example, the SELinux label may be wrong, and subsequently
starting NetworkManager may cause errors. Avoid persisting the secret
key for tests.

(cherry picked from commit 581e1c3269)
2018-11-14 14:18:05 +01:00
Thomas Haller
36ca7dd2c0 core: refactor loading machine-id and cache it
Previously, whenever we needed /etc/machine-id we would re-load it
from file. The are 3 downsides of that:

 - the smallest downside is the runtime overhead of repeatedly
   reading the file and parse it.

 - as we read it multiple times, it may change anytime. Most
   code in NetworkManager does not expect or handle a change of
   the machine-id.
   Generally, the admin should make sure that the machine-id is properly
   initialized before NetworkManager starts, and not change it. As such,
   a change of the machine-id should never happen in practice.
   But if it would change, we would get odd behaviors. Note for example
   how generate_duid_from_machine_id() already cached the generated DUID
   and only read it once.
   It's better to pick the machine-id once, and rely to use the same
   one for the remainder of the program.
   If the admin wants to change the machine-id, NetworkManager must be
   restarted as well (in case the admin cares).
   Also, as we now only load it once, it makes sense to log an error
   (once) when we fail to read the machine-id.

 - previously, loading the machine-id could fail each time. And we
   have to somehow handle that error. It seems, the best thing what we
   anyway can do, is to log an error once and continue with a fake
   machine-id. Here we add a fake machine-id based on the secret-key
   or the boot-id. Now obtaining a machine-id can no longer fail
   and error handling is no longer necessary.

Also, ensure that a machine-id of all zeros is not valid.

Technically, a machine-id is not an RFC 4122 UUID. But it's
the same size, so we also use NMUuid data structure for it.

While at it, also refactor caching of the boot-id and the secret
key. In particular, fix the thread-safety of the double-checked
locking implementations.

(cherry picked from commit 8308311264)
2018-11-14 14:18:02 +01:00
Thomas Haller
81024a9772 core: minor cleanup of initializing nm_utils_get_testing()
- add a commnt about thread-safety.

- minor refactoring initializing the value in nm_utils_get_testing().
  Instead of returning the flags we just set, go back to the begin
  and re-read the value (which must be initialized by now). No big
  difference, but feels a bit nicer to me.

(cherry picked from commit e1413111a7)
2018-11-14 14:17:34 +01:00
Thomas Haller
d4c9401780 all: cleanup GChecksum handling
- prefer nm_auto_free_checksum over explicit free.
- use nm_utils_checksum_get_digest*().
- prefer defines for digest length.
- assume g_checksum_new() cannot fail.

(cherry picked from commit eb9f950a33)
2018-11-14 14:17:34 +01:00
Thomas Haller
7494145649 core: add "nm-sd-utils.h" to access system internal helper
We have a fork of a lot of useful systemd helper code.
However, until now we shyed away from using it aside from
the bits that we really need.

That means, although we have some really nice implementations
in our source-tree, we didn't use them. Either we were missing
them, or we had to re-implement them.

Add "nm-sd-utils.h" header to very carefully make internal
systemd API accessible to the rest of core.

This is not intended as a vehicle to access all of internal
API. Instead, this must be used with care, and only a hand picked
selection of functions must be exposed. Use with caution, but where it
makes sense.

(cherry picked from commit eece5aff09)
2018-11-14 14:17:34 +01:00
Thomas Haller
16bde2d1ec dhcp: log client-id of DHCP instance
(cherry picked from commit 2af1dc1d28)
2018-11-14 14:17:34 +01:00
Thomas Haller
5dc8a14576 libnm: cleanup _nm_utils_hexstr2bin*() helper
Add 3 variants of _nm_utils_hexstr2bin*():

  - _nm_utils_hexstr2bin_full(), which takes a preallocated
    buffer and fills it.
  - _nm_utils_hexstr2bin_alloc() which returns a malloc'ed
    buffer
  - _nm_utils_hexstr2bin_buf(), which fills a preallocated
    buffer of a specific size.

(cherry picked from commit be6c7fa5f6)
2018-11-14 14:17:34 +01:00
Thomas Haller
2a8bef4454 all: drop _nm_utils_bin2hexstr()
We already have nm_utils_bin2hexstr() and _nm_utils_bin2hexstr_full().
This is confusing.

  - nm_utils_bin2hexstr() is public API of libnm. Also, it has
    a last argument @final_len to truncate the string at that
    length.
    It uses no delimiter and lower-case characters.

  - _nm_utils_bin2hexstr_full() does not do any truncation, but
    it has options to specify a delimiter, the character case,
    and to update a given buffer in-place. Also, like
    nm_utils_bin2hexstr() and _nm_utils_bin2hexstr() it can
    allocate a new buffer on demand.

  - _nm_utils_bin2hexstr() would use ':' as delimiter and make
    the case configurable. Also, it would always allocate the returned
    buffer.

It's too much and confusing. Drop _nm_utils_bin2hexstr() which is internal
API and just a wrapper around _nm_utils_bin2hexstr_full().

(cherry picked from commit b537c0388a)
2018-11-14 14:17:34 +01:00
Thomas Haller
cc93cf46ad all/trivial: rename hexstr<>bin conversion functions
"bin2str" and "str2bin" are not very clear. These strings are
hex-strings. Rename.

(cherry picked from commit 6714440669)
2018-11-14 14:17:34 +01:00
Thomas Haller
9ac4bdb501 device: add "dhcp-plugin" match spec for device
The need for this is the following:

"ipv4.dhcp-client-id" can be specified via global connection defaults.
In absence of any configuration in NetworkManager, the default depends
on the DHCP client plugin. In case of "dhclient", the default further
depends on /etc/dhcp.

For "internal" plugin, we may very well want to change the default
client-id to "mac" by universally installing a configuration
snippet

    [connection-use-mac-client-id]
    ipv4.dhcp-client-id=mac

However, if we the user happens to enable "dhclient" plugin, this also
forces the client-id and overrules configuration from /etc/dhcp. The real
problem is, that dhclient can be configured via means outside of NetworkManager,
so our defaults shall not overwrite defaults from /etc/dhcp.

With the new device spec, we can avoid this issue:

    [connection-dhcp-client-id]
    match-device=except:dhcp-plugin:dhclient
    ipv4.dhcp-client-id=mac

This will be part of the solution for rh#1640494. Note that merely
dropping a configuration snippet is not yet enough. More fixes for
DHCP will follow. Also, bug rh#1640494 may have alternative solutions
as well. The nice part of this new feature is that it is generally
useful for configuring connection defaults and not specifically for
the client-id issue.

Note that this match spec is per-device, although the plugin is selected
globally. That makes some sense, because in the future we may or may not
configure the DHCP plugin per-device or per address family.

https://bugzilla.redhat.com/show_bug.cgi?id=1640494
(cherry picked from commit b9eb264efe)
2018-11-14 12:38:05 +01:00
Thomas Haller
9672ea128e core/tests: allow to reset singleton instantiations for testing
Most singletons can only be instantiated once (unless NM_DEFINE_SINGLETON_ALLOW_MULTIPLE
is defined). Otherwise, an assertion will be triggered if the singleton is destroyed
and another instance is requested.

For testing, we want to create multiple singleton instances and being able to reset
the singleton getter. Add a function for that.

(cherry picked from commit 5f4d8ffa79)
2018-11-14 12:38:05 +01:00
Kyle Walker
3ce19034fa dns: remove the resolv.conf 6 entry limit
The resolv.conf used to have a limit of 6 entries for the search option.
With later versions of glibc, this limit has been removed. As a result,
remove the limit here so that all search entries set will be applied to the
resolv.conf. If there is a limit imposed by older versions of glibc, it
should be imposed there as opposed to within NetworkManager.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/80

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/47
(cherry picked from commit 3f2cc579e7)
2018-11-14 10:38:57 +01:00
Thomas Haller
dfce87b2b7 dns: avoid truncation of searches list due to 256 char limit in glibc
Before glibc 2.26, glibc's resolver would only honor 6 search entries
and a character limit of 256. This was lifted recently ([1], [2], [3]).

We also lift this limitation in NetworkManager ([4], [5]).

However, older glibc versions would just truncate the string at 255
characters. In particular, it would not only tuncate the list to 6
entries, but the entry which crosses the 256th character boundary would
be mangled. Avoid that, by adding spaces.

[1] https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=19569
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=21475
[4] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/47
[5] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/80

(cherry picked from commit 49c11a44e4)
2018-11-14 10:38:57 +01:00
Thomas Haller
b78a0ebcb1 dns/tests: add test for writing resolv.conf
(cherry picked from commit 60cd93612f)
2018-11-14 10:38:54 +01:00
Thomas Haller
4515d36fa1 dns: make strv arguments of create_resolv_conf() const
(cherry picked from commit 1c338861c4)
2018-11-14 10:37:41 +01:00
Thomas Haller
ce88f7c404 dns: fix creating resolv.conf content
g_string_new_len() allocates the buffer with length
bytes. Maybe it should be obvious (wasn't to me), but
if a init argument is given, that is taken as containing
length bytes.

So,

    str = g_string_new_len (init, len);

is more like

    str = g_string_new_len (NULL, len);
    g_string_append_len (str, init, len);

and not (how I wrongly thought)

    str = g_string_new_len (NULL, len);
    g_string_append (str, init);

Fixes: 95b006c244
(cherry picked from commit 511709c54d)
2018-11-14 10:35:54 +01:00
Thomas Haller
23d9a5218a dns: refactor create_resolv_conf() to use GString for constructing content
(cherry picked from commit 95b006c244)
2018-11-14 10:35:40 +01:00
Lennart Poettering
fc230dca13 dhcp6: make sure we have enough space for the DHCP6 option header
Fixes a vulnerability originally discovered by Felix Wilhelm from
Google.

CVE-2018-15688
LP: #1795921
https://bugzilla.redhat.com/show_bug.cgi?id=1639067

(cherry picked from commit 4dac5eaba4e419b29c97da38a8b1f82336c2c892)
(cherry picked from commit 01ca2053bb)
2018-10-28 18:46:10 +01:00
Li Song
cb77290a69 sd-dhcp: remove unreachable route after rebinding return NAK
(cherry picked from commit cc3981b1272b9ce37e7d734a7b2f42e84acac535)
(cherry picked from commit 915c2f675a)
2018-10-28 18:46:10 +01:00
Yu Watanabe
f11f5abb1a sd-dhcp6: make dhcp6_option_parse_domainname() not store empty domain
This improves performance of fuzzer.
C.f. oss-fuzz#11019.

(cherry picked from commit 3c72b6ed4252e7ff5f7704bfe44557ec197b47fa)
(cherry picked from commit 50403cccee)
2018-10-28 18:46:10 +01:00
Yu Watanabe
0e93fd895d sd-dhcp6: fix argument and error handling of dhcp6_option_parse_status()
(cherry picked from commit 91c43f3978fa7c8341550b9ca279e460ba7e74e6)
(cherry picked from commit 373cbfc8c6)
2018-10-28 18:46:10 +01:00
Yu Watanabe
91fb1673d5 dhcp6: fix buffer size checking
(cherry picked from commit cb1bdeaf56852275e6b0dd1fba932bb174767f70)
2018-10-28 18:46:10 +01:00
Yu Watanabe
157094abd8 sd-dhcp-lease: fix memleaks
(cherry picked from commit e2975f854831d08a25b4f5eb329b6d04102e115f)
2018-10-28 18:37:27 +01:00
Taegil Bae
4f2c6dd264 meson: set RPATH for libnm_device_plugin_wwan.so
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/26
(cherry picked from commit 4b2dc8826d)
2018-10-24 09:59:46 +02:00
Taegil Bae
4ebe6f1e26 meson: set RPATH for libnm_device_plugin_bluetooth.so
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/26
(cherry picked from commit 82b8ef2252)
2018-10-24 09:59:44 +02:00