From 151fbc5a4d47e92ede3e7680b22cb4f870e792abe72fe1ada61300bb1afdfb40 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 28 Mar 2018 13:15:01 +0000 Subject: [PATCH] Accepting request 592049 from home:Andreas_Schwab:Factory - res-send-enomem.patch: Fix crash in resolver on memory allocation failure (bsc#1086690, BZ #23005) OBS-URL: https://build.opensuse.org/request/show/592049 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=501 --- glibc.changes | 6 ++++++ glibc.spec | 3 +++ res-send-enomem.patch | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 res-send-enomem.patch diff --git a/glibc.changes b/glibc.changes index e069074..a58e6a9 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 27 11:30:49 UTC 2018 - schwab@suse.de + +- res-send-enomem.patch: Fix crash in resolver on memory allocation + failure (bsc#1086690, BZ #23005) + ------------------------------------------------------------------- Thu Mar 22 09:48:53 UTC 2018 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 57133d3..699994b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -300,6 +300,8 @@ Patch1007: i386-sigaction-sa-restorer.patch Patch1008: riscv-tls-init.patch # PATCH-FIX-UPSTREAM RISC-V: fmax/fmin: Handle signalling NaNs correctly (BZ #22884) Patch1009: riscv-fmax-fmin-nan.patch +# PATCH-FIX-UPSTREAM Fix crash in resolver on memory allocation failure (BZ #23005) +Patch1010: res-send-enomem.patch ### # Patches awaiting upstream approval @@ -519,6 +521,7 @@ mv crypt_blowfish-%crypt_bf_version/*.[chS] crypt/ %patch1007 -p1 %patch1008 -p1 %patch1009 -p1 +%patch1010 -p1 %patch2000 -p1 %patch2004 -p1 diff --git a/res-send-enomem.patch b/res-send-enomem.patch new file mode 100644 index 0000000..de216f1 --- /dev/null +++ b/res-send-enomem.patch @@ -0,0 +1,20 @@ + [BZ #23005] + * resolv/res_send.c (__res_context_send): Return ENOMEM if + allocation of private copy of nsaddr_list fails. + +Index: glibc-2.27/resolv/res_send.c +=================================================================== +--- glibc-2.27.orig/resolv/res_send.c ++++ glibc-2.27/resolv/res_send.c +@@ -471,6 +471,11 @@ __res_context_send (struct resolv_contex + '\0', + sizeof (struct sockaddr_in6) + - sizeof (struct sockaddr_in)); ++ else ++ { ++ __set_errno (ENOMEM); ++ return -1; ++ } + } + EXT(statp).nscount = statp->nscount; + }