lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <91d18e79-b8fd-4ad1-95eb-dab888f58a2f@bootlin.com>
Date: Wed, 31 Jul 2024 07:47:00 +0200
From: Alexis Lothoré <alexis.lothore@...tlin.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: Alexei Starovoitov <ast@...nel.org>,
 Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>,
 Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
 Yonghong Song <yonghong.song@...ux.dev>,
 John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
 Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
 Jiri Olsa <jolsa@...nel.org>, Mykola Lysenko <mykolal@...com>,
 Shuah Khan <shuah@...nel.org>, ebpf@...uxfoundation.org,
 Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
 Alan Maguire <alan.maguire@...cle.com>, bpf@...r.kernel.org,
 linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 2/3] selftests/bpf: convert test_dev_cgroup to
 test_progs

Hello Martin,

On 7/31/24 02:34, Martin KaFai Lau wrote:
> On 7/30/24 4:59 AM, Alexis Lothoré (eBPF Foundation) wrote:
>> +static void test_read(const char *path, char *buf, int buf_size,
>> +              int expected_ret)
>> +{
>> +    int ret, fd;
>> +
>> +    fd = open(path, O_RDONLY);
>> +
>> +    /* A bare open on unauthorized device should fail */
>> +    if (expected_ret < 0) {
>> +        ASSERT_EQ(fd, expected_ret, "open file for read");
> 
> One nit. expected_ret is actually expected_errno. It just happens -EPERM is -1,
> so testing fd against expected_errno works here but is confusing to read. How
> about separating the fd and errno test in the access rejected case. First test
> for fd == -1 and then test for errno == expected_errno.

Ah you are right, I mixed up things here, I'll fix it.

> Please also carry Stanislav's Ack in patch 1 and 3 in the next respin.

Sure, will do.

Thanks,

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ