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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b66564e-2582-03b2-56f1-8037f8aca886@linux.dev>
Date:   Fri, 16 Sep 2022 17:03:42 -0700
From:   Martin KaFai Lau <martin.lau@...ux.dev>
To:     Pu Lehui <pulehui@...weicloud.com>,
        Stanislav Fomichev <sdf@...gle.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Quentin Monnet <quentin@...valent.com>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>, Hao Luo <haoluo@...gle.com>,
        Jiri Olsa <jolsa@...nel.org>, Pu Lehui <pulehui@...wei.com>,
        bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 1/2] bpf, cgroup: Don't populate
 prog_attach_flags array when effective query

On 9/14/22 9:17 AM, Pu Lehui wrote:
> From: Pu Lehui <pulehui@...wei.com>
> 
> Attach flags is only valid for attached progs of this layer cgroup,
> but not for effective progs. For querying with EFFECTIVE flags,
> exporting attach flags does not make sense. so we don't need to
> populate prog_attach_flags array when effective query.

prog_attach_flags has been added to 6.0 which is in rc5.  It is still 
doable (and cleaner) to reject prog_attach_flags when it is an 
effective_query.  This should be done regardless of 'type == 
BPF_LSM_CGROUP' or not.  Something like:

if (effective_query && prog_attach_flags)
     return -EINVAL;

Otherwise, the whole prog_attach_flags needs to be set to 0 during 
effective_query.  Please target the change to the bpf tree instead of 
bpf-next such that this uapi bit can be fixed before 6.0.

Also, the effective_query issue is not limited to the prog_attach_flags? 
For the older uattr->query.attach_flags, it should be set to 0 also when 
it is an effective_query, right?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ