Re: [PATCH] bpf: Fix excessive memory allocation in stack_map_alloc()

From: Greg KH
Date: Mon Jun 13 2022 - 04:01:32 EST


On Thu, Jun 09, 2022 at 12:07:28AM +0800, Yuntao Wang wrote:
> On Wed, 8 Jun 2022 17:20:58 +0200, Greg KH wrote:
> > On Wed, Jun 08, 2022 at 10:25:38PM +0800, Yuntao Wang wrote:
> > > The 'n_buckets * (value_size + sizeof(struct stack_map_bucket))' part of
> > > the allocated memory for 'smap' is never used, get rid of it.
> > >
> > > Fixes: b936ca643ade ("bpf: rework memlock-based memory accounting for maps")
> > > Signed-off-by: Yuntao Wang <ytcoode@xxxxxxxxx>
> > > Link: https://lore.kernel.org/bpf/20220407130423.798386-1-ytcoode@xxxxxxxxx
> > > ---
> > > This is the modified version for 5.10, the original patch is:
> > >
> > > [ Upstream commit b45043192b3e481304062938a6561da2ceea46a6 ]
> > >
> > > It would be better if the new patch can be reviewed by someone else.
> >
> > What is wrong with the version that we have queued up in the 5.10-stable
> > review queue right now?
>
> Since the 5.10 branch doesn't have commit 370868107bf6, the upstream version
> is not correct for it, I modified the original patch and wanted to backport
> it to the 5.10 branch.

This does not apply to the 5.10 branch now, can you provide a working
version?

thanks,

greg k-h