[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPhsuW76RGkXBDPdWWFsN6xc6_0rUGBEGgwq-xAEtUU4O9y9ow@mail.gmail.com>
Date: Thu, 16 Apr 2020 14:45:24 -0700
From: Song Liu <song@...nel.org>
To: Jesper Dangaard Brouer <brouer@...hat.com>
Cc: Toke Høiland-Jørgensen <toke@...hat.com>,
Daniel Borkmann <daniel@...earbox.net>,
Alexei Starovoitov <ast@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>, Xiumei Mu <xmu@...hat.com>
Subject: Re: [PATCH bpf v2] cpumap: Avoid warning when CONFIG_DEBUG_PER_CPU_MAPS
is enabled
On Thu, Apr 16, 2020 at 2:11 AM Jesper Dangaard Brouer
<brouer@...hat.com> wrote:
>
> On Thu, 16 Apr 2020 10:31:20 +0200
> Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> > When the kernel is built with CONFIG_DEBUG_PER_CPU_MAPS, the cpumap code
> > can trigger a spurious warning if CONFIG_CPUMASK_OFFSTACK is also set. This
> > happens because in this configuration, NR_CPUS can be larger than
> > nr_cpumask_bits, so the initial check in cpu_map_alloc() is not sufficient
> > to guard against hitting the warning in cpumask_check().
> >
> > Fix this by explicitly checking the supplied key against the
> > nr_cpumask_bits variable before calling cpu_possible().
> >
> > Fixes: 6710e1126934 ("bpf: introduce new bpf cpu map type BPF_MAP_TYPE_CPUMAP")
> > Cc: Jesper Dangaard Brouer <brouer@...hat.com>
> > Reported-by: Xiumei Mu <xmu@...hat.com>
> > Tested-by: Xiumei Mu <xmu@...hat.com>
> > Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
> > ---
>
> Acked-by: Jesper Dangaard Brouer <brouer@...hat.com>
Acked-by: Song Liu <songliubraving@...com>
Powered by blists - more mailing lists