Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3888996pxy; Mon, 26 Apr 2021 12:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVNnkKDsUMNEj6WzbqKzeX2VjQvjgHl76g0Y0H+CB/1ogSpwa4mTi1GoMtHDg4VIM2Y7vF X-Received: by 2002:a17:906:82d4:: with SMTP id a20mr11847330ejy.14.1619464286709; Mon, 26 Apr 2021 12:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619464286; cv=none; d=google.com; s=arc-20160816; b=gv9tajmdyUp7J94N3j2K57Im0mWxKweGUn1lydykvHXfSozVYyvGI3aMp9msS3Dp/O NZbimUL5P2xQ0WwSHJ6Fz/nek9ZGZLOyPbH33Q8EA5Oyt08S0HirVhLIucPaVI0aUxtu wFSrfFb3Z+utSCvP3pSp0fhB40/XXWvmdcElM9xPPRrGcTgIWxMujj+n2NMOcgYDFabl aNfJf95iTw0Rq8CLNDxPsqVB39BTJAw+QqK0u6Zqv7ySeHsv8WLpDMnpx/rocGVnOdXA nLj7/i8LXXl+qsynzhVMsYIbqi+jwdE9jyT2UudAlbnAnNkWH8+uzyfOr6momR+xa8Pt SXyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=sImtnFIf2IiGLj1moI9Axaabj+1/JIUf9WTF63IiVmI=; b=v2B2kKU6QOun40yF5GIx3AadGS6VpsqL47uXgsVeS5elURuk80iKfQxcAfzOsxfIIA 1AkdE/CWbIhJ/9yCOTZG0uXydxsGW4Dm2/yxA6ka435/8erx0mB8fUqkvkqNOvJAujDD QRdVVKIfWRzttKQDJnD0Hf82JJSB3qDJjk8wWg3zPmcXSldccbz8Glb/PP0+N/D8+EHN r7HxPgR6NqaCvwbYpGgH0rNSSBS6By5WdOHmshFnQ5Ll4DwP8ywP83lJ4Eep1lNNUbYD vl9GyAFHvMssUKHu+/BQCkqH74jXLlBfCt5LTToM/0o1PvAOkUQ0yM4p8/3uzlzNXOTD +NZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm3 header.b=7VLdJfUU; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=ZNQLyKaB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si5318629ejc.628.2021.04.26.12.11.03; Mon, 26 Apr 2021 12:11:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm3 header.b=7VLdJfUU; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=ZNQLyKaB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239361AbhDZSxH (ORCPT + 99 others); Mon, 26 Apr 2021 14:53:07 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:55109 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237631AbhDZSwg (ORCPT ); Mon, 26 Apr 2021 14:52:36 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 073CC580B58; Mon, 26 Apr 2021 14:51:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 26 Apr 2021 14:51:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=sImtnFIf2IiGLj1moI9Axaabj+1 /JIUf9WTF63IiVmI=; b=7VLdJfUUGvVQcSqhypULyrzoviMfJLOD8sJ0oV6jKOM DreychR1086TvYsxPf2fXhedJhJq3kAJw7r8vXf+WFXLs+pcHkhPhrTsMm5lkbmU rZr0NV+13i75V/xFaIILYYtRtQMiv5/vvffYp/32eeYdtgZN/XSv7KhOLzeZvsfn lTyG/DmbZzRyIngMbDayAp/55lb8RZRJoB8uMlFgorzf0QgFxcnKDSU4VpuBXSH8 SDQsGEs1ASoz4xoHUBvdRBQGTXcrz77Qpcsr0IMnkpxJE3T7qgxWaHzGCy1URcOt S7wW9aLc0H7IcYXXq25zWXgbuoDgiffDmwaIaSjvdxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=sImtnF If2IiGLj1moI9Axaabj+1/JIUf9WTF63IiVmI=; b=ZNQLyKaB+hPmesLsB5Gb5X FaCa0ONSitPlEOSsHfBfsE9a/4IMCfWVlsy+EIKz90taXHrtOL5Q/Ocdu18c/uWg duW1Ej1/K1O0/enz6zMe8baBG+3Bnl960exXDSrfe59KhZw1k85sjjjlkF8m7lz9 hgVQbBqImTu6t50sjMbFQMhUyCatd6wNDWUBOfuO3vGV+6wPadjyHDV6+JSywEZ2 bTMXErDJvMRxnVuVj211o2+xx9wndpcSzYggG5VbERxA+PQeJKUCtNoWCUvLIMi9 YxmvXN7XDpKYUE6bxvcPf+BM9PW7DASJ7+lpwoTgIOZRQZgwFg44G4kd28fEayng == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddukedgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepvfihtghh ohcutehnuggvrhhsvghnuceothihtghhohesthihtghhohdrphhiiiiirgeqnecuggftrf grthhtvghrnhepgeekfeejgeektdejgfefudelkeeuteejgefhhfeugffffeelheegieef vdfgtefhnecukfhppedujeefrdefkedruddujedrkeehnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepthihtghhohesthihtghhohdrphhiiiii rg X-ME-Proxy: Received: from cisco (unknown [173.38.117.85]) by mail.messagingengine.com (Postfix) with ESMTPA id 43CDC1080066; Mon, 26 Apr 2021 14:51:39 -0400 (EDT) Date: Mon, 26 Apr 2021 12:51:38 -0600 From: Tycho Andersen To: Sargun Dhillon Cc: Kees Cook , LKML , Linux Containers , Rodrigo Campos , Christian Brauner , Mauricio =?iso-8859-1?Q?V=E1squez?= Bernal , Giuseppe Scrivano , Andy Lutomirski , Will Drewry , Alban Crequy Subject: Re: [PATCH RESEND 3/5] selftests/seccomp: Add test for wait killable notifier Message-ID: <20210426185138.GA1605795@cisco> References: <20210426180610.2363-1-sargun@sargun.me> <20210426180610.2363-4-sargun@sargun.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210426180610.2363-4-sargun@sargun.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 26, 2021 at 11:06:08AM -0700, Sargun Dhillon wrote: > +TEST(user_notification_signal_wait_killable) > +{ > + pid_t pid; > + long ret; > + int status, listener, sk_pair[2]; > + struct seccomp_notif req = { > + .flags = SECCOMP_USER_NOTIF_FLAG_WAIT_KILLABLE, > + }; > + struct seccomp_notif_resp resp = {}; > + char c; > + > + ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); > + ASSERT_EQ(0, ret) { > + TH_LOG("Kernel does not support PR_SET_NO_NEW_PRIVS!"); > + } > + > + ASSERT_EQ(socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sk_pair), 0); > + ASSERT_EQ(fcntl(sk_pair[0], F_SETFL, O_NONBLOCK), 0); > + > + listener = user_notif_syscall(__NR_gettid, > + SECCOMP_FILTER_FLAG_NEW_LISTENER); > + ASSERT_GE(listener, 0); > + > + pid = fork(); > + ASSERT_GE(pid, 0); > + > + if (pid == 0) { > + close(sk_pair[0]); > + handled = sk_pair[1]; > + if (signal(SIGUSR1, signal_handler) == SIG_ERR) { I think here you want a write(handled, "x", 1), right? Tycho