diff options
Diffstat (limited to 'meta/recipes-extended/libsolv/libsolv/0008-Fix-Be-sure-that-NONBLOCK-is-set.patch')
-rw-r--r-- | meta/recipes-extended/libsolv/libsolv/0008-Fix-Be-sure-that-NONBLOCK-is-set.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-extended/libsolv/libsolv/0008-Fix-Be-sure-that-NONBLOCK-is-set.patch b/meta/recipes-extended/libsolv/libsolv/0008-Fix-Be-sure-that-NONBLOCK-is-set.patch new file mode 100644 index 0000000000..fdea9dbdb5 --- /dev/null +++ b/meta/recipes-extended/libsolv/libsolv/0008-Fix-Be-sure-that-NONBLOCK-is-set.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From ebb51f73491987435664ac14b79bebe16ffbdd5c Mon Sep 17 00:00:00 2001 | ||
2 | From: Jaroslav Rohel <jrohel@redhat.com> | ||
3 | Date: Tue, 11 Dec 2018 12:40:42 +0100 | ||
4 | Subject: [PATCH] Fix: Be sure that NONBLOCK is set | ||
5 | Reply-To: muislam@microsoft.com | ||
6 | |||
7 | CVE: CVE-2018-20532 CVE-2018-20533 CVE-2018-20534 | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Signed-off-by: Muminul Islam <muislam@microsoft.com> | ||
12 | |||
13 | Cherry picked from https://github.com/openSUSE/libsolv/pull/291/commits | ||
14 | --- | ||
15 | examples/solv/fastestmirror.c | 6 +++++- | ||
16 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/examples/solv/fastestmirror.c b/examples/solv/fastestmirror.c | ||
19 | index d2ebd97a..0ee4e73b 100644 | ||
20 | --- a/examples/solv/fastestmirror.c | ||
21 | +++ b/examples/solv/fastestmirror.c | ||
22 | @@ -68,7 +68,11 @@ findfastest(char **urls, int nurls) | ||
23 | socks[i] = socket(result->ai_family, result->ai_socktype, result->ai_protocol); | ||
24 | if (socks[i] >= 0) | ||
25 | { | ||
26 | - fcntl(socks[i], F_SETFL, O_NONBLOCK); | ||
27 | + if (fcntl(socks[i], F_SETFL, O_NONBLOCK) == -1) | ||
28 | + { | ||
29 | + close(socks[i]); | ||
30 | + socks[i] = -1; | ||
31 | + } | ||
32 | if (connect(socks[i], result->ai_addr, result->ai_addrlen) == -1) | ||
33 | { | ||
34 | if (errno != EINPROGRESS) | ||
35 | -- | ||
36 | 2.23.0 | ||
37 | |||