Commit graph

12746 commits

Author SHA1 Message Date
Lennart Poettering
361d374a0f 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)
(cherry picked from commit fc230dca13)
(cherry picked from commit cc1e5a7f57)
(cherry picked from commit c3221cb0c5)
(cherry picked from commit f4f7655341)
(cherry picked from commit 2a25872910)
(cherry picked from commit ec471872e4)
(cherry picked from commit 6e56de0d87)
2018-10-29 21:56:12 +01:00
Thomas Haller
4e6dced5a0 clients: fix appending integer to result in nmc_property_set_bytes()
(cherry picked from commit d76c190dc7)
(cherry picked from commit 06d3c95e4f)
(cherry picked from commit fb9c302af7)
(cherry picked from commit 8b4c1cddfe)
2017-05-23 16:51:07 +02:00
Beniamino Galvani
ee96001f3c clients: fix setter for 802-1x.password-raw
The property is a GBytes, not a GByteArray.

https://bugzilla.gnome.org/show_bug.cgi?id=782836
(cherry picked from commit 30393ee236)
(cherry picked from commit cc6c9468fc)
(cherry picked from commit e4750efb23)
(cherry picked from commit d4cbae9aa0)
2017-05-23 16:51:06 +02:00
Lubomir Rintel
30d8ad21e8 sparse: avoid clash with __bitwise and __force from 4.10 linux/types.h
It also used __bitwise and __force. It seems easier to rename
our versions since they are local to this one single header.

Also, undefine them afteerwards, so that we don't pollute the
preprocessor macro namespace.

https://github.com/systemd/systemd/pull/5061
(cherry picked from commit 13b2ac2214)
(cherry picked from commit 2f92d8cee1)
(cherry picked from commit 2623afb442)
2017-05-23 16:50:52 +02:00
Thomas Haller
3a6fe7b048 libnm: fix memleak of GUdevDevice in get_bus_name()
Fixes: f7b1b28202
(cherry picked from commit c033330c41)
(cherry picked from commit 6311bf6666)
(cherry picked from commit 42eb57c0c1)
(cherry picked from commit 90d341e300)
2017-03-20 11:36:18 +01:00
Francesco Giudici
99e829d543 libnm-core: remove INFERRABLE flag from dhcp-hostname property
When assuming a dhcp connection don't consider the DHCP "Host Name"
Option (12) passed in the DHCP request for the match of the available
connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1393997
(cherry picked from commit 0ce7da1e22)
(cherry picked from commit 86490fbb1d)
(cherry picked from commit 984c634cdb)
2017-02-06 17:59:48 +01:00
Thomas Haller
611d34d38e supplicant: fix detection of EAP-FAST
At least with my supplicant, the capability is called
all-upper-case "FAST".

The check used case-insensitive, but that was broken
by a previous change.

Fixes: 9f5f141100
(cherry picked from commit 66ff601ecf)
(cherry picked from commit 1caae3743d)
(cherry picked from commit d0ee773221)
(cherry picked from commit 1f48f89459)
2017-01-18 19:01:39 +01:00
Thomas Haller
606db03ac3 keyfile: fix memleak in keyfile reader's read_array_of_uint()
Fixes: 9559a7a260
(cherry picked from commit 8239edbb9b)
(cherry picked from commit 8a281bf7b4)
(cherry picked from commit 92f057ca1d)
2017-01-05 12:34:17 +01:00
Beniamino Galvani
dca9dec4b1 team: check return value of g_dbus_connection_call_sync()
The call can fail; in such case assume that an existing teamd died and
our instance will be able to continue.

https://bugzilla.redhat.com/show_bug.cgi?id=1347015
(cherry picked from commit 072358dad0)
(cherry picked from commit 90677c1c66)
2016-06-21 15:18:30 +02:00
Thomas Haller
e0805fc686 device: reconfigure IP addressing after bringing up device
For changing the hardware address, we must bring the device down. When doing
that, IP addressing is lost and it must be re-configured after bringing the
device up again.

We already do something similar in device_link_changed(), but that might
not be sufficient, because device_link_changed() is run on an idle
handler, thus, while changing the hardware address it has no chance to
run (or notice that the device was shortly down).

https://bugzilla.redhat.com/show_bug.cgi?id=1309899
(cherry picked from commit 63571b2666)
(cherry picked from commit 951013d1e1)
2016-05-30 18:18:44 +02:00
Beniamino Galvani
e9d8c4e44e dns/dnsmasq: use servers without split DNS if no domain was received
When a VPN server doesn't push any DNS domain, we want to use the
received servers for all queries.

https://bugzilla.gnome.org/show_bug.cgi?id=766769
(cherry picked from commit dd3dfad583)
(cherry picked from commit 0c80e38f64)
2016-05-26 10:39:10 +02:00
Thomas Haller
e7c70c4ab2 device: merge branch 'th/device-ip-config-on-link-up-rh1309899'
https://bugzilla.redhat.com/show_bug.cgi?id=1309899

(cherry picked from commit 05010747b2)
(cherry picked from commit 0c3dc9d326)
2016-05-12 16:22:03 +02:00
Thomas Haller
8d9e033ecd platform: ensure refetching routes when link goes down
It's not enough to consider IF_LOWER_UP flag. Instead,
the important flag is actually IF_UP.

Actually, I suspect that IF_LOWER_UP is not needed. But for
now leave it, in order not to break something.

(cherry picked from commit 02e84ba1e8)
(cherry picked from commit 11bfe8a881)
2016-05-12 16:19:28 +02:00
Thomas Haller
6fa2405997 device: restore IP configuration when link comes up
This is especially important, because changing MTU takes the
link down for a moment. Taking a link down deletes IP routes and
IPv6 addresses. Thus, when the link comes up again, we must restore
them.

Otherwise, we don't call merge_and_apply() until the next DHCP lease
(or possibly never in case of static addressing).

https://bugzilla.redhat.com/show_bug.cgi?id=1309899
(cherry picked from commit 35a7ea77b0)
(cherry picked from commit 5367eac814)
2016-05-12 16:19:28 +02:00
Thomas Haller
c3946c3d29 device: improve logging when changing IP configuration
nm_device_set_ip4_config() is called during cleanup and
from ip4_config_merge_and_apply(). The latter, has several
call sites.

It's not easy to track whether we called set_ip4_config with
or without commit (and if we call it without commit, we might
not see a logging line at all).

(same for nm_device_set_ip6_config()/ip6_config_merge_and_apply()).

(cherry picked from commit f50e39fc98)
(cherry picked from commit a3b3e17bf9)
2016-05-12 16:19:23 +02:00
Beniamino Galvani
46ef667de8 device: remove pending dhcp actions also in IP_DONE state
When the IP status is IP_DONE and a DHCP transaction succeeds the
'dhcp4' and 'dhcp6' pending actions must be removed. Without this, a
temporary link loss just after the activation would cause a DHCP
restart and those actions would remain set, blocking the startup.

https://bugzilla.redhat.com/show_bug.cgi?id=1330893
(cherry picked from commit 21ca2cf0f6)
2016-05-10 18:12:09 +02:00
Thomas Haller
a5fc83ad4e device: remove duplicate calls to get_generic_capabilities() during device construction
Fixes: 2236cc5eb8
2016-05-09 17:49:32 +02:00
Beniamino Galvani
fc6b8ba1bf device/ethernet: ignore s390 'portname' attribute when not set
The 'portname' sysfs attribute of s390 devices is deprecated since
kernel 4.4 and always set to 'no portname required'. But even on older
kernels such value must be interpreted as an unset portname and thus
ignored.

https://bugzilla.redhat.com/show_bug.cgi?id=1327204
(cherry picked from commit 0589e659ca)
2016-04-28 09:29:39 +02:00
Lubomir Rintel
ba77eb5f43 bluetooth: add a missing GError initializer
(cherry picked from commit 3ad7be3e6a)
(cherry picked from commit a57227914e)
2016-04-25 16:11:05 +02:00
Dan Williams
a6deb2b1f9 misc: update maintainers and authors 2016-04-21 13:39:38 -05:00
Beniamino Galvani
6aeec6860d examples: fix crash in add-connection-libnm
Reported-by: Ali Nematollahi <alirezan1@gmail.com>
(cherry picked from commit 76348adb8e)
2016-04-20 07:53:02 +02:00
Thomas Haller
868365180c rdisc: fix build failure due to lack of g_clear_pointer()
Fixes: 10c3e11804
2016-04-17 13:21:35 +02:00
Thomas Haller
645bf63e0b rdisc: backport rate-limiting failures to send router solicitations
https://bugzilla.gnome.org/show_bug.cgi?id=759596
2016-04-17 13:04:56 +02:00
Thomas Haller
d0c7a2bd82 rdisc: fix regression in send_rs() (cannot create router solicitation)
Fixes: 21efcfe6b5
(cherry picked from commit 793e985918)
2016-04-17 13:03:18 +02:00
Thomas Haller
10c3e11804 rdisc: downgrade logging severity and rate-limit logging for sending router solicitation
Downgrade the severity for failure to send router solicitations
to WARN level. Also, repeated (identical) lines will be further
downgraded to DEBUG level.

Also pass the error reason to the caller and combine the message with
the "sending router solicitation" message.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775736
https://bugzilla.redhat.com/show_bug.cgi?id=1034443
https://bugzilla.redhat.com/show_bug.cgi?id=1010540
https://lists.launchpad.net/touch-packages/msg75697.html

https://bugzilla.gnome.org/show_bug.cgi?id=759596
(cherry picked from commit 21efcfe6b5)
2016-04-17 13:00:20 +02:00
Thomas Haller
9a127cd424 core: add NM_UTILS_ERROR 2016-04-17 12:57:49 +02:00
Beniamino Galvani
383997306d device/vlan: update hw address also during prepare phase
The hardware address of a VLAN must be kept aligned with the one of
its parent device, and we already used a signal in NMDeviceVlan to
catch changes in parent address and update the VLAN device
accordingly.

But this didn't work in all cases because the change might happen
after the VLAN gets created but before we register the signal, so it
is necessary to add further checks to enforce the alignment during the
device activation.

https://bugzilla.redhat.com/show_bug.cgi?id=1325752
(cherry picked from commit 8e405e99f0)
2016-04-14 14:24:48 +02:00
Francesco Giudici
a5dc355d4d wifi: merge branch 'fg/nm-1-0_wifi_segfault_rh1325631'
https://bugzilla.redhat.com/show_bug.cgi?id=1325631
2016-04-13 18:51:28 +02:00
Francesco Giudici
a08b23ec35 device: minor logging change in platform_link_added()
Show ignored devices in debug level.

(cherry picked from commit 7796c489fd)
2016-04-13 12:03:44 +02:00
Francesco Giudici
5f8ae4e1e5 device: ensure @error always set by nm_device_factory_new_link
https://bugzilla.redhat.com/show_bug.cgi?id=1325631
(backported from commit c5d827057e)
2016-04-13 12:03:12 +02:00
Thomas Haller
a72dd80a94 macros: add NM_SET_OUT() macro
(cherry picked from commit d4d2e65eb7)
2016-04-11 15:32:48 +02:00
Francesco Giudici
70c0defe75 wifi: hack for wext devices reporting IW_MODE_AUTO configuration mode.
https://bugzilla.gnome.org/show_bug.cgi?id=763388
(cherry picked from commit 0f6febc6fb)
2016-04-11 11:12:41 +02:00
Lubomir Rintel
13eb842d7e release: bump version to 1.0.13 (development) 2016-04-02 00:34:51 +02:00
Lubomir Rintel
5fea022c0e release: bump version to 1.0.12 2016-04-02 00:26:17 +02:00
Lubomir Rintel
077d4cbe04 release: update NEWS 2016-04-02 00:19:47 +02:00
Lubomir Rintel
747c4dff2f device: check may_fail when progressing to IP_CHECK
Don't let the device progress to check and then in turn to activated unless all
the required IP configuration is in place.

(cherry picked from commit 7d1709d7f6)
2016-04-01 23:48:22 +02:00
Lubomir Rintel
21c98f5da9 manager: don't the already activated devices shouldn't be considered added
The NMSettings shouldn't generate a new default wired connection for
devices that are being deactivated.

(cherry picked from commit ec542df4df)
2016-04-01 15:09:55 +02:00
Nikolay Martynov
5476ea5c45 device: renew dhcp leases on awake for software devices
This makes sure that devices like bond get their dhcp renewed

[thaller@redhat.com: original patch modified to rename
 now-public function update_dynamic_ip_setup()]

https://bugzilla.gnome.org/show_bug.cgi?id=764398
(cherry picked from commit 28e9ec499a)
2016-03-31 16:47:34 +02:00
Lubomir Rintel
ab5a81021d wifi: avoid autoconnecting Ad-Hoc networks with method=auto
This fixes the issue where all Ad-Hoc networks try to connect one after one on
NM startup instead of the managed network that has AP available.

Fixes: e2637760f1
(cherry picked from commit f6d0fc3341)
2016-03-24 14:48:28 +01:00
Lubomir Rintel
6772259630 supplicant-config: fix misleading indentation
(cherry picked from commit 357a1c61a0)
2016-03-20 17:06:24 +01:00
Francesco Giudici
79127634e5 dhcp: fix GBytes leak in nm_dhcp_client_start_ip4()
(cherry picked from commit 99ad9df342)
2016-03-18 14:51:15 +01:00
Lubomir Rintel
058dfebf7b ifupdown: fix up a bad rebase
Fixes: 0cb45af977
(cherry picked from commit e4aaa48b82)
2016-03-14 16:40:46 +01:00
Lubomir Rintel
b2acf82276 ifupdown: set wireless mode
(cherry picked from commit 1b826d9dd9)
2016-03-14 16:36:59 +01:00
Lubomir Rintel
7d1b0fa835 ifupdown: ssid is now GBytes for quite some time
Fixes: c43f88907b
(cherry picked from commit b6bbf3df1e)
2016-03-14 16:36:59 +01:00
Lubomir Rintel
1fc6495552 ifupdown: wireless-essid is good too
(cherry picked from commit 5b14492b0b)
2016-03-14 16:36:59 +01:00
Lubomir Rintel
b97560bc1f ifupdown: don't remove the object in its constructor
This is wrong an all the complexity of a property and associated bookkeeping is
completely unnecessary.

(cherry picked from commit 0cb45af977)
2016-03-14 16:36:53 +01:00
Lubomir Rintel
0a112e12ce ifupdown: drop a bogus warning
The key might be a wireless setting that has already been processed, not a
wireless-security setting.

(cherry picked from commit a5c204a69a)
2016-03-14 16:36:23 +01:00
Thomas Haller
1fe054d319 wifi: merge branch 'th/supplicant-manager-fix-ref-count-rh1298007'
https://bugzilla.redhat.com/show_bug.cgi?id=1298007
https://bugzilla.redhat.com/show_bug.cgi?id=1241198
https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00094.html

(cherry picked from commit de19bc20d0)
2016-03-02 16:44:17 +01:00
Thomas Haller
3c612f9d54 wifi: fix crash due to wrong ownership handling in nm_supplicant_manager_iface_release()
nm_supplicant_manager_iface_get() would cache and reuse the supplicant
interface. But no ref-counting was in place so that the first user returning
the interface via nm_supplicant_manager_iface_release() would destroy the
instance for others.

This is broken for a very long time. Which shows that we hardly ever
have a cache-hit and usually create a new instance. So, instead of
letting nm_supplicant_manager_create_interface() check for existing
supplicant interface, always create a new instance. This also makes
sense, because we would expect that per ifname only one instance is
requested at a time. Also add an assertion that we don't return
multiple supplicant interface instances for the same ifname.

Drop nm_supplicant_manager_iface_release() in favor of requiring users
to unref the returned instance.

Also, use a GSList instead of a GHashTable for the cache.

Also, previously callers would pass @is_wireless to nm_supplicant_manager_iface_get(),
but the cache lookup did not consider that value. That doesn't matter
now as we always create a new instance.

https://bugzilla.redhat.com/show_bug.cgi?id=1298007
(cherry picked from commit f1fba3eb02)
2016-03-02 16:43:54 +01:00
Thomas Haller
dd6239bdf6 supplicant: don't pass start_now argument to nm_supplicant_interface_new()
Also, don't only consider the @die_count whether to start the supplicant,
but check for is_available() -- which already considers @die_count and
@running.

(cherry picked from commit 063f9185b9)
2016-03-02 16:43:54 +01:00