[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e62a539b-614c-c008-873a-f9c57c7ecb33@digikod.net>
Date: Tue, 29 Nov 2022 12:03:25 +0100
From: Mickaël Salaün <mic@...ikod.net>
To: limin <limin100@...wei.com>, shuah@...nel.org,
linux-kselftest@...r.kernel.org,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: hannes@...xchg.org, mhocko@...nel.org, roman.gushchin@...ux.dev,
shakeelb@...gle.com, songmuchun@...edance.com, tj@...nel.org,
lizefan.x@...edance.com
Subject: Re: [PATCH -next] selftests/landlock: Fix selftest ptrace_test run
fail
I tested with next-20221116 and all tests are OK. Could you share your
kernel configuration with a link? What is the content of /proc/cmdline?
On 29/11/2022 02:42, limin wrote:
> I run test on Linux ubuntu2204 6.1.0-next-20221116
>
> I did't use yama.
>
> you can reproduce by this step:
>
> cd kernel_src
>
> cd tools/testing/selftests/landlock/
> make
> ./ptrace_test
>
>
>
>
> On 2022/11/29 3:44, Mickaël Salaün wrote:
>> 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 <limin100@...wei.com>
>>> ---
>>> 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) {
Powered by blists - more mailing lists