Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15464264rwb; Mon, 28 Nov 2022 11:54:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf5JWOIHq8qwvXskHoyXCgQk8QeyJApYswnaH20rBl2U7mBMukbVOhBfDC3STMjzno6MZqFJ X-Received: by 2002:a17:907:2c45:b0:7b8:bbbe:5ca with SMTP id hf5-20020a1709072c4500b007b8bbbe05camr27669253ejc.544.1669665298772; Mon, 28 Nov 2022 11:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669665298; cv=none; d=google.com; s=arc-20160816; b=enHiJSzAsgoLPNUYIgYHfwD/xQvruNxZdIM5EXh2XA7cK6DoZhp3EhYNgTpLGCzoaH yOrI36ZJxu87YuQn34EZ2Bdea32OUJK3N21OuBHpoPR3lMsLP6XddszMA5J0lLhFs68U bcI31YgWH54OY0y6hm/4VqLj6g872bxjP/LvLcySkmGCZXjsu0V7DF70VF4scA5tN8EY ctil3x4G9Hvdxow303B0Xaun1YHgzq/C5Be6F0UaVC39s577dSF3NBN9B7fy20P3VMIH lG2GcSR26RTMT4Pn0+I1qXNE8nr/WUlq+zVVAM6677/qr2DBp8jDddUOpH9Dxi3zSRmB H/4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Jm65VRFlo42LID0Hi0ZWvAPY/ppL2fVISmyqCwMGa2o=; b=jke4jV6sTCL4tauzjEZubSPC8iBzHobceaxRCPzbM4awO3HNSiBKGGbUJEHR2L7oDb uYQiEUS4Dpugfqufam5FtVEjuuANkN89Q4Kjf+6itiTqD+pCfE84cx8ebeD4qj4yi3ga M4PFempR6agyrQMpbcXWJJ6SvZxtS42p9TjOYB8O4VE5blFESXyjSGgkgVGGir4tYGHl Jap0oqGVnfNTC4FWR/uOdP4dDJXWDHmCo17rcfBEno6KG2d+HQFmroTm4vvDMf1cCS5e 0/a1LmNMY7FfDfcqZRlHmG9UDn4sCuBhbSota/BMzKFKsa4AZOt1PCc6Fk+g69PTOq6S 0/PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b="R/XAxh8P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd30-20020a170907629e00b0078e1e216396si11010256ejc.66.2022.11.28.11.54.37; Mon, 28 Nov 2022 11:54:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b="R/XAxh8P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233753AbiK1Toz (ORCPT + 84 others); Mon, 28 Nov 2022 14:44:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbiK1Tox (ORCPT ); Mon, 28 Nov 2022 14:44:53 -0500 Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [IPv6:2001:1600:4:17::bc08]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85EC0205CF for ; Mon, 28 Nov 2022 11:44:49 -0800 (PST) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4NLbXH1PfpzMq2xb; Mon, 28 Nov 2022 20:44:47 +0100 (CET) Received: from ns3096276.ip-94-23-54.eu (unknown [23.97.221.149]) by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4NLbXG0YsSz3b; Mon, 28 Nov 2022 20:44:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1669664687; bh=xtG6qsMJEfUAt6o9RtMO7Q9XohBwkoKwmV/hAY7T+fk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=R/XAxh8PlLTIrSeHXZgYmfRsKzExLYNoB3M5VKPSHJU0PAuzhH7fLzerfGiPFnje5 0S95vulRmmaxsNkv4e8Zr212jNQx/sbWsXZcEcGbE4IKRujgIRCCaAoi3SyDV59/NY RXeiQKkoTai2lF12S33yMaKorotSHLqSqSEB/krE= Message-ID: <1232e4f3-e4b8-ff23-61e8-5465c8406f6e@digikod.net> Date: Mon, 28 Nov 2022 20:44:44 +0100 MIME-Version: 1.0 User-Agent: Subject: Re: [PATCH -next] selftests/landlock: Fix selftest ptrace_test run fail Content-Language: en-US To: limin , shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, songmuchun@bytedance.com, tj@kernel.org, lizefan.x@bytedance.com References: <20221128020409.1545717-1-limin100@huawei.com> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= In-Reply-To: <20221128020409.1545717-1-limin100@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Infomaniak-Routing: alpha X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch changes the test semantic and then cannot work on my test environment. On which kernel did you run test? Do you use Yama or something similar? On 28/11/2022 03:04, limin wrote: > Tests PTRACE_ATTACH and PTRACE_MODE_READ on the parent, > trace parent return -1 when child== 0 > How to reproduce warning: > $ make -C tools/testing/selftests TARGETS=landlock run_tests > > Signed-off-by: limin > --- > tools/testing/selftests/landlock/ptrace_test.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/selftests/landlock/ptrace_test.c b/tools/testing/selftests/landlock/ptrace_test.c > index c28ef98ff3ac..88c4dc63eea0 100644 > --- a/tools/testing/selftests/landlock/ptrace_test.c > +++ b/tools/testing/selftests/landlock/ptrace_test.c > @@ -267,12 +267,11 @@ TEST_F(hierarchy, trace) > /* Tests PTRACE_ATTACH and PTRACE_MODE_READ on the parent. */ > err_proc_read = test_ptrace_read(parent); > ret = ptrace(PTRACE_ATTACH, parent, NULL, 0); > + EXPECT_EQ(-1, ret); > + EXPECT_EQ(EPERM, errno); > if (variant->domain_child) { > - EXPECT_EQ(-1, ret); > - EXPECT_EQ(EPERM, errno); > EXPECT_EQ(EACCES, err_proc_read); > } else { > - EXPECT_EQ(0, ret); > EXPECT_EQ(0, err_proc_read); > } > if (ret == 0) {