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: 930797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93320-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="QL6rpzSm"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418Sy40CR9z9s0W for ; Mon, 18 Jun 2018 21:08:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= RMmxEnlWslrKaKaB7TWDTQAz8AnLD4DI/FRhFGCXGkjVLyOtBZc3quU52G3b4Vl1 3tlzzKaMB87TQCaxtqyg6/G6LNe0QcrcQY1VnraOZPJ/UN0QcXgOKdJEkFc9SJqG 1iSTKNt2CpskQ/oJKSdLC3jSiUnzpOQzn1t5CEiSUV4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=xwJ8k8 O8F5ajp+TQawf7CZbrFOo=; b=QL6rpzSmltroU4qN5yi8l1cjYkoTOpVZbQRGvi jgIreKfePhUeIFPFxWFOwfp/HZo22NnpwK73vQYQ38Djktezt8KECdwz+iZ/YyU0 EgxfUx04IWuDrEfIlWXozgbP70X/hf2Ewo0rGLovi09AWqUFegwihoz486ypNKfB 8WH5c= 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)) {