From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 26E965A026F for ; Mon, 26 Jun 2023 09:22:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687764143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qYinf1M1JJnDbMuZRyYtl1/emlyDRlfQ80z12U+F+iw=; b=cjvli+u0tqsgPzUaNa4LOFV5dfqYVJEb+f3lLCz+emOjoy9ujJ3gn09skSVdWjy356nD8m AVMs0yVQK+5sF0dRLADxndtEv6bvhK+CuuR5Nm9DZWgf0sXs8S3jyhOmqpaW0FQLP72jBX lOlDlLc96ezoMJbw69YlKR4Yvxd90Yo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-_-TguMXtPgGMIKlofaHjRQ-1; Mon, 26 Jun 2023 03:22:19 -0400 X-MC-Unique: _-TguMXtPgGMIKlofaHjRQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0A3F0858F1E; Mon, 26 Jun 2023 07:22:19 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 658F614682F9; Mon, 26 Jun 2023 07:22:18 +0000 (UTC) Date: Mon, 26 Jun 2023 09:22:11 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] seccomp: Make seccomp.sh re-entrancy safe Message-ID: <20230626092211.193e1965@elisabeth> In-Reply-To: <20230621030637.640272-1-david@gibson.dropbear.id.au> References: <20230621030637.640272-1-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 74OJCI5WAWJA567F743CQMP3YBGOUPJH X-Message-ID-Hash: 74OJCI5WAWJA567F743CQMP3YBGOUPJH X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 21 Jun 2023 13:06:37 +1000 David Gibson wrote: > seccomp.sh generates seccomp.h piece by piece using >> directives. This > means that if two instances of seccomp.h are run concurrently a corrupted > version of seccomp.h will be generated. Amongst other problems this can > cause spurious failures on clang-tidy. > > Alter seccomp.sh to build the output in a temporary file and atomic move it > to seccomp.h, so concurrent invocations will still result in valud output. > > Signed-off-by: David Gibson Applied. -- Stefano