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] [day] [month] [year] [list]
Message-ID: <Y9FVJjbBvIjwwd0S@maniforge>
Date:   Wed, 25 Jan 2023 10:13:26 -0600
From:   David Vernet <void@...ifault.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>, Yonghong Song <yhs@...a.com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Kernel Team <kernel-team@...a.com>, Tejun Heo <tj@...nel.org>,
        Kumar Kartikeya Dwivedi <memxor@...il.com>
Subject: Re: [PATCH bpf-next v3 2/7] bpf: Enable cpumasks to be queried and
 used as kptrs

On Wed, Jan 25, 2023 at 08:01:49AM -0800, Alexei Starovoitov wrote:
> On Wed, Jan 25, 2023 at 6:38 AM David Vernet <void@...ifault.com> wrote:
> > +
> > +void bpf_cpumask_set_cpu(u32 cpu, struct bpf_cpumask *cpumask)
> > +{
> > +       if (!cpu_valid(cpu))
> > +               return;
> > +
> > +       cpumask_set_cpu(cpu, (struct cpumask *)cpumask);
> 
> I was considering suggesting to use &cpumask->cpumask here and
> in other cases, but figured it's better to leave it as-is,
> since bpf prog will be doing this cast, so it matches.
> Maybe some build assertion is necessary to make sure it's the first member.
> Probably overkill as well.

IMO a build assertion is a good idea. Serves as documentation and a
sanity check. I'll send it out in a follow-on patch, unless you really
think it's overkill.

> 
> Applied.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ