[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF1bQ=S70mgCx8FKKePv1Lgp5UhJzn=Y9pPWjvjbWzzsjDKMmA@mail.gmail.com>
Date: Mon, 3 Nov 2025 13:11:25 -0800
From: Rong Xu <xur@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>, linux-kernel@...r.kernel.org, 
	Sriraman Tallam <tmsriram@...gle.com>, Han Shen <shenhan@...gle.com>, 
	Krzysztof Pszeniczny <kpszeniczny@...gle.com>
Subject: Re: [PATCH 1/2] objtool: fix the check for dead_end function with
 multiple sibliing calls
While investigating a fix for the split function, I noticed this issue
in the code.
I'm not sure if we have multiple sibling calls in the current kernel
source. But I think
we should fix it.
The split function issue did affect us in the production.
Thanks,
-Rong
On Mon, Nov 3, 2025 at 1:01 PM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Mon, Nov 03, 2025 at 06:51:53PM +0000, xur@...gle.com wrote:
> > From: Rong Xu <xur@...gle.com>
> >
> > If a function has multiple sibling calls, the dead_end check should
> > only return true if all sibling call targets are also dead_end
> > functions.
>
> Cute, however did you find this?
>
> > Signed-off-by: Rong Xu <xur@...gle.com>
> > Reviewed-by: Sriraman Tallam <tmsriram@...gle.com>
> > Reviewed-by: Han Shen <shenhan@...gle.com>
> > Reviewed-by: Krzysztof Pszeniczny <kpszeniczny@...gle.com>
> > ---
> >  tools/objtool/check.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> > index 9004fbc067693..c2ee3c3a84a62 100644
> > --- a/tools/objtool/check.c
> > +++ b/tools/objtool/check.c
> > @@ -314,7 +314,13 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
> >                               return false;
> >                       }
> >
> > -                     return __dead_end_function(file, insn_func(dest), recursion+1);
> > +                     /*
> > +                      * A function can have multiple sibling calls. All of
> > +                      * them need to be dead ends for the function to be a
> > +                      * dead end too.
> > +                      */
> > +                     if (!__dead_end_function(file, insn_func(dest), recursion+1))
> > +                             return false;
> >               }
> >       }
> >
> >
> > base-commit: 6146a0f1dfae5d37442a9ddcba012add260bceb0
> > --
> > 2.51.2.997.g839fc31de9-goog
> >
Powered by blists - more mailing lists