In message: Re: [linux-yocto] [v5.15/standard/base][PATCH] bpf: Fix indentation 
in grow_stack_state()
on 23/08/2024 Bruce Ashfield wrote:

> In message: [linux-yocto] [v5.15/standard/base][PATCH] bpf: Fix indentation 
> in grow_stack_state()
> on 22/08/2024 Zhang, Liyin (CN) via lists.yoctoproject.org wrote:
> 
> > From: Liyin Zhang <liyin.zhang...@windriver.com>
> > 
> > Fix the below warning which introduced by commit 81c12119c2 used to
> > fix CVE-2023-52452.
> 
> Can we elaborate more in this commit log how we ended up with
> the indentation that caused the warning?
> 
> The upstream commit (6b4a64bafd107) looks to have the same
> indentation as your fix .. so was it just something that
> happened in our version of the patch ?

Kevin sent a patch for the same thing with an explanation
that made sense.

I merged that patch, so there's no need of a v2 of this.

Bruce

> 
> Bruce
> 
> > 
> > kernel/bpf/verifier.c: In function 'grow_stack_state':
> > kernel/bpf/verifier.c:866:5: error: this 'if' clause does not guard... 
> > [-Werror=misleading-indentation]
> >   866 |     if (env->subprog_info[state->subprogno].stack_depth < size)
> >       |     ^~
> > kernel/bpf/verifier.c:869:9: note: ...this statement, but the latter is 
> > misleadingly indented as if it were guarded by the 'if'
> >   869 |         return 0;
> >       |
> > 
> > Signed-off-by: Liyin Zhang <liyin.zhang...@windriver.com>
> > ---
> >  kernel/bpf/verifier.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index df30d7be19aa..03e95aa32731 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -864,7 +864,7 @@ static int grow_stack_state(struct bpf_verifier_env 
> > *env, struct bpf_func_state
> >  
> >      /* update known max for given subprogram */
> >      if (env->subprog_info[state->subprogno].stack_depth < size)
> > -        env->subprog_info[state->subprogno].stack_depth = size;
> > +            env->subprog_info[state->subprogno].stack_depth = size;
> >  
> >     return 0;
> >  }
> > -- 
> > 2.25.1
> > 
> 
> > 
> > 
> > 
> 
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#14323): 
https://lists.yoctoproject.org/g/linux-yocto/message/14323
Mute This Topic: https://lists.yoctoproject.org/mt/108034903/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to