mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 09:10:10 +01:00
platform: fix double closing netlink socket
The file descriptor is owned by the netlink socket instance,
which we close in finalize. We most not close it when destroying
the IO channel, otherwise the file descriptor gets closed twice.
Closing an invalid file descriptor (or a descriptor that is already closed)
is a serious bug, because the integer values are re-used, so there is a race
that the close might affect an innocent file descriptor instead of just
failing with EBADF.
(cherry picked from commit 79482c9a9e)
This commit is contained in:
parent
fc2894508e
commit
39002a4e3c
1 changed files with 0 additions and 1 deletions
|
|
@ -6758,7 +6758,6 @@ constructed (GObject *_object)
|
|||
|
||||
priv->event_channel = g_io_channel_unix_new (nl_socket_get_fd (priv->nlh));
|
||||
g_io_channel_set_encoding (priv->event_channel, NULL, NULL);
|
||||
g_io_channel_set_close_on_unref (priv->event_channel, TRUE);
|
||||
|
||||
channel_flags = g_io_channel_get_flags (priv->event_channel);
|
||||
status = g_io_channel_set_flags (priv->event_channel,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue