!161 fix network coredump

From: @yangmingtaip
Reviewed-by: @overweight
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2021-09-09 14:33:40 +00:00 committed by Gitee
commit c1ca35c2e1
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From b1b0b42e48303134731e017a108c6c334ef5f4c8 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 17 Sep 2019 21:29:23 +0900
Subject: [PATCH] network: add missing link->network checks
When the function is called, no network file may be assigned to the
link.
---
src/network/networkd-link.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f1aeb7287e34..46d55f64dc5b 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2393,9 +2393,9 @@ static int link_drop_foreign_config(Link *link) {
continue;
if (link_address_is_dynamic(link, address)) {
- if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
+ if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
continue;
- } else if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC))
+ } else if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC))
continue;
if (link_is_static_address_configured(link, address)) {
@@ -2435,11 +2435,11 @@ static int link_drop_foreign_config(Link *link) {
in_addr_equal(AF_INET6, &route->dst, &(union in_addr_union) { .in6 = {{{ 0xff,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 }}} }))
continue;
- if (route->protocol == RTPROT_STATIC &&
+ if (route->protocol == RTPROT_STATIC && link->network &&
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC))
continue;
- if (route->protocol == RTPROT_DHCP &&
+ if (route->protocol == RTPROT_DHCP && link->network &&
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
continue;

View File

@ -16,7 +16,7 @@
Name: systemd
Url: https://www.freedesktop.org/wiki/Software/systemd
Version: 243
Release: 45
Release: 46
License: MIT and LGPLv2+ and GPLv2+
Summary: System and Service Manager
@ -137,6 +137,7 @@ Patch0089: backport-stat-util-add-stat_inode_unmodified-helper-that-chec.pa
Patch0090: backport-basic-stat-util-make-mtime-check-stricter-and-use-en.patch
Patch0091: backport-udev-make-algorithm-that-selects-highest-priority-de.patch
Patch0092: backport-tentatively-ignore-FORCERENEW-command.patch
Patch0093: backport-network-add-missing-link-network-checks.patch
#openEuler
Patch9002: 1509-fix-journal-file-descriptors-leak-problems.patch
@ -1524,6 +1525,9 @@ fi
%exclude /usr/share/man/man3/*
%changelog
* Thu Sep 9 2021 yangmingtai <yangmingtai@huawei.com> - 243-46
- fix network coredump after install cloud-init
* Mon Aug 16 2021 yangmingtai <yangmingtai@huawei.com> - 243-45
- Type:CVE
- ID:CVE-2020-13529