[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQK_ftwe5Dxtc0bopeDg2ku=GrFYrMOUWHLnXaK1bqoXXA@mail.gmail.com>
Date: Tue, 9 Jul 2024 11:11:59 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: Vlastimil Babka <vbabka@...e.cz>,
Linux regressions mailing list <regressions@...ts.linux.dev>,
Mohammad Shehar Yaar Tausif <sheharyaar48@...il.com>, Martin KaFai Lau <martin.lau@...ux.dev>,
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@...gle.com>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, bpf <bpf@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Javier Carrasco <javier.carrasco.cruz@...il.com>, Christian Kujau <lists@...dbynature.de>,
Péter Ujfalusi <peter.ujfalusi@...el.com>,
Lorenzo Stoakes <lstoakes@...il.com>, Kent Overstreet <kent.overstreet@...ux.dev>
Subject: Re: [PATCH RESEND] bpf: fix order of args in call to bpf_map_kvcalloc
On Tue, Jul 9, 2024 at 8:39 AM Suren Baghdasaryan <surenb@...gle.com> wrote:
>
> On Tue, Jul 9, 2024 at 8:14 AM Vlastimil Babka <vbabka@...e.cz> wrote:
> >
> > On 7/8/24 10:20 AM, Linux regression tracking (Thorsten Leemhuis) wrote:
> > > [CCing the regressions list and people mentioned below]
> > >
> > > On 12.06.24 16:53, Alexei Starovoitov wrote:
> > >> On Wed, Jun 12, 2024 at 2:51 AM Mohammad Shehar Yaar Tausif
> > >> <sheharyaar48@...il.com> wrote:
> > >>>
> > >>> The original function call passed size of smap->bucket before the number of
> > >>> buckets which raises the error 'calloc-transposed-args' on compilation.
> > >>>
> > >>> Fixes: 62827d612ae5 ("bpf: Remove __bpf_local_storage_map_alloc")
> > >>> Reviewed-by: Andrii Nakryiko <andrii@...nel.org>
> > >>> Signed-off-by: Mohammad Shehar Yaar Tausif <sheharyaar48@...il.com>
> > >>> ---
> > >>> - already merged in linux-next
> > >>> - [1] suggested sending as a fix for 6.10 cycle
> > >>
> > >> No. It's not a fix.
> > >
> > > If you have a minute, could you please explain why that is? From what I
> > > can see a quite a few people run into build problems with 6.10-rc
> > > recently that are fixed by the patch:
> > >
> > > * Péter Ujfalusi
> > > https://lore.kernel.org/bpf/363ad8d1-a2d2-4fca-b66a-3d838eb5def9@intel.com/
> > >
> > > * Christian Kujau
> > > https://lore.kernel.org/bpf/48360912-b239-51f2-8f25-07a46516dc76@nerdbynature.de/
> > > https://lore.kernel.org/lkml/d0dd2457-ab58-1b08-caa4-93eaa2de221e@nerdbynature.de/
> > >
> > > * Lorenzo Stoakes
> > > https://fosstodon.org/@ljs@social.kernel.org/112734050799590482
> > >
> > > At the same time I see that the culprit mentioned above is from 6.4-rc1,
> >
> > IIUC the order was wrong even before, but see below.
> >
> > > so I guess it there must be some other reason why a few people seem to
> > > tun into this now. Did some other change expose this problem? Or are
> > > updated compilers causing this?
> >
> > I think it's because of 2c321f3f70bc ("mm: change inlined allocation helpers
> > to account at the call site"), which was added in 6.10-rc1 and thus makes
> > this technically a 6.10 regression after all.
>
> IIUC the above mentioned change reveals a problem that was there
> before the change. So, it's a build regression in 6.10 because the bug
> got exposed but the bug was introduced much earlier. The fix should be
> marked as:
>
> Fixes: ddef81b5fd1d ("bpf: use bpf_map_kvcalloc in bpf_local_storage")
Not really. The order was flipped before that patch.
> > So what triggers the bug is
> > AFAICS the following together:
> >
> > - gcc-14 (didn't see it with gcc-13)
> > - commit 2c321f3f70bc that makes bpf_map_kvcalloc a macro that does
> > kvcalloc() directly instead of static inline function wrapping it for
> > !CONFIG_MEMCG
> > - CONFIG_MEMCG=n in .config
Can somebody respin the patch with above details?
tbh I don't think it qualifies as a "bug".
Plenty of code places mix up size/n arguments to calloc.
Erroring the build in such cases is imo wrong.
Not sure what makes gcc-14 produce such warn/error.
But since the patch is trivial we can get that in quickly.
Pls respin with all details.
Powered by blists - more mailing lists