Message ID | 20230915091608.3207005-1-dominique.martinet@atmark-techno.com |
---|---|
State | Accepted |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <swupdate+bncBCWIVBV7SUGRBYGBSCUAMGQEUDZOI5I@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=S8N2l1X7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::13d; helo=mail-il1-x13d.google.com; envelope-from=swupdate+bncbcwivbv7sugrbygbscuamgqeudzoi5i@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-il1-x13d.google.com (mail-il1-x13d.google.com [IPv6:2607:f8b0:4864:20::13d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rn7pp3XWkz1ygG for <incoming@patchwork.ozlabs.org>; Fri, 15 Sep 2023 19:16:18 +1000 (AEST) Received: by mail-il1-x13d.google.com with SMTP id e9e14a558f8ab-34bbbf67e03sf13598395ab.1 for <incoming@patchwork.ozlabs.org>; Fri, 15 Sep 2023 02:16:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694769376; cv=pass; d=google.com; s=arc-20160816; b=zgDEWaxXZMeC6+AaueS+CRJ2xvR0h5blXeaeI5e5J0r0wGuyytrUHz8vJZHE50Nuqh fGJ293EeUcAAE2wMApRXowDQylee6Xs5yW70oDOsy4s9TzBDTX9tZ1D27lzzSeVErZO0 +5fm9XPkSrZ+PGZst7eLMezMlGBuS54gyqUuUKiE29RCzY0a/hQ/J5hlcBWy0DWAspQj vscX8wrwSxOGxTKlzoxlcR8gIPvvre6XXfxeuoPB9kDwtKYucVsWt5XtBmq+Nm06Gmfq s9lHmRtTiDMFkXX+m4TDWUsL1sjD0Uor3cU2RovD46WivQ2O8fxcGEQEhoPHn6ZgIqMS kpOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=R3mkrJGyI8ARkgio/eCrZ9wMbafHIyYDosZlZp+ZtQE=; fh=p1uCM7+Dy57llgaJqDV8WVSDsDW3qLgXM2yWsEWRo8U=; b=XX+P6c/JP6P4tevuHF1tv6I9+3+/H5vHiNHRd6A9I2cICaIFtOJnD5eqAAH0ArPx97 WojTAEI8sw+kFD1zdvGC+a3TDlCWFWw3uiTszBZ8/zKdrZNVPAy1OWTH0oIL+tDdgXWY O61ctAxRyB4G5uoOEHcDppOak2PyVcNPzoVL8zC+f8y0ImMEpKYlM7RIHbPN56oD6+0E 3joT4HP8AhMLvbdF0Zn3r0z2SSs2eqagyr/9yNq3uxxjTPa/kaCxGyCM4lQyLdF0Jy7j hGnkxL6WRe0Olqc4r3R57GSG7f6rZxYH5XBZDrR4oqlvDzXI1vyn9D7Oa798aFN7sQU7 lDUQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 13.115.124.170 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1694769376; x=1695374176; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=R3mkrJGyI8ARkgio/eCrZ9wMbafHIyYDosZlZp+ZtQE=; b=S8N2l1X7RfSKNs65cRjiO2hUHUqhlavS/BEza+NXF3jqfWuaOIZJP+J90E6Z/H3Xyi vMQ2Fr1c6ySEQohZtx/5wwH1UdtJiI+xf6Ljuhel/ogdtR0kxz1xxBPnmPOivT3HrAgG nM/UAQT/J+bvHPugHvu5reGXJGRm6BT1CFp8YgaYdwrOSWDiaDyTp49Q1pZr3O5j5h5m Ru6rT4LfncwLWhvr0we0MZBcVzo8TFpSGbkRmseHJsx/bkcRV/oNeJNOwh6n7WbKtDYf KA3kKE9ZuKdkR52NzWet2GS0RgJiSeaAnLwjgASjXnFr/9I0maIDhTij4kwgd/DgW5I5 PVLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694769376; x=1695374176; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=R3mkrJGyI8ARkgio/eCrZ9wMbafHIyYDosZlZp+ZtQE=; b=goMzmYtIuTcV+qHv4fCMBJMOS+vefEpxHx/kZdjICwfwvR+I6FFAdTyuAHVLZ9G4hQ XIt4k0H6G6ei318BRkGxXO4QVMKShTiU5IhEYVlRzylabBdzaS4xR+giMMqGsNzTXzp1 RgraOyRy5/iuUT1YFeJ10UuBgJhwLL3liMjtoJR1DjzXI9WfvY9W+L/A7z5/XW0fjshy bzWfI6IsKwPxxsHnOAZftBDJ3+MmDpbPWWhd3X37L6bS6Cx4LUGN8MFGv5QRVO0Y8PQI iYbQ0mujTN79ngHL/4MwhvzrGZVQhP7ojIxmo6lwokw0ywitOVW+MFUBrzICsjgl1XUf 6Gig== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0Yz2FNxEfPSG+J/No6D8xfBqA9w0ia5nqp7XJgxzemt3j840xdvB gHu8hFY2LMmDNlDAu/TTlM8= X-Google-Smtp-Source: AGHT+IF7d929ihBYrWwvpUePfuVRO/Mq3l0iN01dSkLdWI+7bvX1HTkBwQWmxJu7WIpcn/vE1DmdvQ== X-Received: by 2002:a05:6e02:1314:b0:34f:4632:4e09 with SMTP id g20-20020a056e02131400b0034f46324e09mr1337578ilr.23.1694769376552; Fri, 15 Sep 2023 02:16:16 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a92:bd11:0:b0:342:2a4b:458e with SMTP id c17-20020a92bd11000000b003422a4b458els185165ile.0.-pod-prod-01-us; Fri, 15 Sep 2023 02:16:15 -0700 (PDT) X-Received: by 2002:a5e:a714:0:b0:780:d031:bc42 with SMTP id b20-20020a5ea714000000b00780d031bc42mr1088780iod.16.1694769375396; Fri, 15 Sep 2023 02:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694769375; cv=none; d=google.com; s=arc-20160816; b=iz+7Prhexzkds7OCjv14oGnyclCwoQksDS3mk20Rcinri08VOEoyXudlmz743bg2UZ +/S6XhXeQcmROZjPKa/U/ZRdx4/9fF54nFusSG91ZEV4pCMhuq2rfYE24Q4grzVyeewX cVIwkWk+fyLtwHtQdylyUGgQRLqp2tJn8xf6gy8wcQJ8/bmRgtlBXae6CQp/7ao04W/b 2JTkyYUZLk5ypL+ABAKu7B2vEWRWnzCTn+CnpS3YWf9SfP/8ceF+S4vCpxqhIXyTfF3N aWjj1vp2SNFpn8NaDFBi3bbp1QSRG1zbfKApLL3RIbWnmimPehm5AYbbc1kFBdWWvgml LWuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=L3n1U6MUDHK1Ue5J42T2y0D458UIh3h+EUZNI/d4meI=; fh=p1uCM7+Dy57llgaJqDV8WVSDsDW3qLgXM2yWsEWRo8U=; b=xWCDr2COdK4fgQaGVQWB3kwmXOAK9aZuNQGAV1wtZRDryO1K58w6zw1mqIY6Zvoqcr mr77J2KFtmIzg3i66/hxSx/EpnXJgRArt0P43pPNnsmBk5Xfp7igdgU+stfu/9Dxc2O6 KM566lNPiaDoIxZ/qDim3/x9A7BogghK+ADgba8pCxcAP/sTMaF+yQ438zY3BBZ6pjc+ nHypagCxSCgDdRSJWl6A7SEUqyFfYiLKQSWTP0TdE5XoRQyaI1lx3e8nM43AW48ejyxt FDDzIZfQIzhxKoLR1US6YsBh1fibXLZSQb1rddvtfD5xEribm1xvKhLOw++i9bv76+is IfRA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 13.115.124.170 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com Received: from gw.atmark-techno.com (gw.atmark-techno.com. [13.115.124.170]) by gmr-mx.google.com with ESMTPS id ee20-20020a056602489400b0079186e18eb9si528255iob.3.2023.09.15.02.16.15 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of dominique.martinet@atmark-techno.com designates 13.115.124.170 as permitted sender) client-ip=13.115.124.170; Received: from gw.atmark-techno.com (localhost [127.0.0.1]) by gw.atmark-techno.com (Postfix) with ESMTP id 2F304600D6 for <swupdate@googlegroups.com>; Fri, 15 Sep 2023 18:16:13 +0900 (JST) Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by gw.atmark-techno.com (Postfix) with ESMTPS id DCE7F600D6 for <swupdate@googlegroups.com>; Fri, 15 Sep 2023 18:16:12 +0900 (JST) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-26f6ed09f59so1639122a91.1 for <swupdate@googlegroups.com>; Fri, 15 Sep 2023 02:16:12 -0700 (PDT) X-Received: by 2002:a17:90a:e285:b0:268:7ec:51ae with SMTP id d5-20020a17090ae28500b0026807ec51aemr843693pjz.41.1694769372016; Fri, 15 Sep 2023 02:16:12 -0700 (PDT) X-Received: by 2002:a17:90a:e285:b0:268:7ec:51ae with SMTP id d5-20020a17090ae28500b0026807ec51aemr843685pjz.41.1694769371749; Fri, 15 Sep 2023 02:16:11 -0700 (PDT) Received: from pc-zest.atmarktech (162.198.187.35.bc.googleusercontent.com. [35.187.198.162]) by smtp.gmail.com with ESMTPSA id bt1-20020a17090af00100b00267b38f5e13sm2431735pjb.2.2023.09.15.02.16.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2023 02:16:11 -0700 (PDT) Received: from [::1] (helo=pc-zest.atmark.tech) by pc-zest.atmarktech with esmtp (Exim 4.96) (envelope-from <dominique.martinet@atmark-techno.com>) id 1qh4vq-00DSIA-0h; Fri, 15 Sep 2023 18:16:10 +0900 From: Dominique Martinet <dominique.martinet@atmark-techno.com> To: swupdate@googlegroups.com Cc: Dominique Martinet <dominique.martinet@atmark-techno.com>, Christian Storm <christian.storm@siemens.com> Subject: [swupdate] [PATCH 1/2] prepare_ipc: set client fd as CLOEXEC Date: Fri, 15 Sep 2023 18:16:07 +0900 Message-Id: <20230915091608.3207005-1-dominique.martinet@atmark-techno.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Original-Sender: dominique.martinet@atmark-techno.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 13.115.124.170 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/2] prepare_ipc: set client fd as CLOEXEC
|
expand
|
diff --git a/ipc/network_ipc.c b/ipc/network_ipc.c index 6c8c03ae4617..63552c6df29a 100644 --- a/ipc/network_ipc.c +++ b/ipc/network_ipc.c @@ -43,7 +43,7 @@ static int prepare_ipc(void) { int connfd; struct sockaddr_un servaddr; - connfd = socket(AF_LOCAL, SOCK_STREAM, 0); + connfd = socket(AF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); if (connfd < 0) return -1;
This fd was seen leaking in scripts. Use CLOEXEC to avoid interferences from buggy scripts. Note SOCK_CLOEXEC is not POSIX, but BSDs seem to define it: https://man.openbsd.org/socket.2 https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2 Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> Cc: Christian Storm <christian.storm@siemens.com> --- Added Christian in Ccs for BSD sanity check, but I think it's OK. If you want to stick to posix, happy to resend this as a patch that does fcntl on the socket after its creation to set CLOEXEC instead. ipc/network_ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)