Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE789C4361B for ; Wed, 16 Dec 2020 11:23:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85F552255F for ; Wed, 16 Dec 2020 11:23:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85F552255F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.55180.96090 (Exim 4.92) (envelope-from ) id 1kpUtI-0008Sp-Bw; Wed, 16 Dec 2020 11:22:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 55180.96090; Wed, 16 Dec 2020 11:22:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpUtI-0008Si-8S; Wed, 16 Dec 2020 11:22:44 +0000 Received: by outflank-mailman (input) for mailman id 55180; Wed, 16 Dec 2020 11:22:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kpUtH-0008Sd-M6 for xen-devel@lists.xenproject.org; Wed, 16 Dec 2020 11:22:43 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 550920ef-f32e-4602-bd0f-c4deb4847fea; Wed, 16 Dec 2020 11:22:41 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 550920ef-f32e-4602-bd0f-c4deb4847fea DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1608117760; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=penWowEIrCCaT2sBFgkZanUNFuHURfWJOg9gJ17z3GA=; b=RArOC3mhCmwk+WukgVOuiHb8fqX9Q0QWs24a1AyzPjlEHaf7XHNASqcK IEWzZ8ZnjZGL3DtblPOpysjKGQ8/AbJATYPObpC/efbSTfoIbKerQUYBK 3a0nEQjkEVLpUqC0AwLO6fW9bJgpLXhUfZjp1ZwiGLO8sWCltYugIswZD U=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: j+gInFzWtNVKXfq625TT/LdLZ7Z/jsMfLEJtcpjbKmykuFCB/fGmQgm5cL3Y1jcFlx646Mm+rb COsAvbr502XlI2ROmcj4cqAoLL8zQX0PWkbiytau4/DXW5IjJWYGNqJUSGqv9kmStcdbN++9ZA HVK2Knf0di9TKKgkSq6dCHaStl2n/Y0tcnXM4ZZ1Jbn5zrbQmg7JgLc/UN2FbVRMesyGJ3P/Vu YhbQcHpZZB8OW1o6Ic0Y6urncLt6/mnAEIbdHEeNNY0U/LSCoQTcvilXYLl0IuNCijbNOgr038 dBY= X-SBRS: 5.2 X-MesageID: 33570766 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.78,424,1599537600"; d="scan'208";a="33570766" Subject: Re: [PATCH v10 04/25] tools/libxenevtchn: add possibility to not close file descriptor on exec To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= , CC: Ian Jackson , Wei Liu , Julien Grall References: <20201215163603.21700-1-jgross@suse.com> <20201215163603.21700-5-jgross@suse.com> <3c8ab988-725e-2823-23f6-d9286a04243e@citrix.com> From: Andrew Cooper Message-ID: <0ae8f6c8-266f-98e2-df83-17eeacabeaed@citrix.com> Date: Wed, 16 Dec 2020 11:22:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To FTLPEX02CL03.citrite.net (10.13.108.165) On 16/12/2020 06:06, J=C3=BCrgen Gro=C3=9F wrote: > On 15.12.20 19:09, Andrew Cooper wrote:=C2=A0 >> >> Additionally, something in core.c should check for unknown flags and >> reject them them with EINVAL.=C2=A0 It was buggy that this wasn't done= >> before, and really needs to be implemented before we start having case= s >> where people might plausibly pass something other than 0. > > Are you sure this is safe? I'm not arguing against it, but we considere= d > to do that and didn't dare to. Well - you're already breaking things by adding meaning to bit 0 where it was previously ignored. But fundamentally - any caller passing non-zero to begin with is buggy, and it will be less bad to fix up our input validation and given them a clean EINVAL now. The alternative is no error and some weird side effect when we implement whichever bit they were settings. ~Andrew