From patchwork Mon Jun 18 11:08:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 27901 Received: (qmail 28601 invoked by alias); 18 Jun 2018 11:08:21 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28437 invoked by uid 89); 18 Jun 2018 11:08:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Date: Mon, 18 Jun 2018 13:08:16 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] Linux: Create Netlink socket with SOCK_CLOEXEC in __check_pf [BZ #15722] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20180618110816.E8B2F401BD607@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2018-06-18 Florian Weimer [BZ #15722] * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): Create Netlink socket with SOCK_CLOEXEC. diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c index 36326abe80..04cd104aec 100644 --- a/sysdeps/unix/sysv/linux/check_pf.c +++ b/sysdeps/unix/sysv/linux/check_pf.c @@ -313,7 +313,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6, } else { - int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + int fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); if (__glibc_likely (fd >= 0)) {