Re: [PATCH] objtool: Fix stack overflow in validate_branch()

From: Josh Poimboeuf

Date: Wed Dec 03 2025 - 18:53:40 EST


On Wed, Dec 03, 2025 at 08:15:19PM +0100, Ingo Molnar wrote:
> * Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> > On Wed, Dec 03, 2025 at 10:54:19AM -0800, Josh Poimboeuf wrote:
> > > Keep in mind this is a worst case function for objtool: KASAN with tons
> > > of memory accesses. The vast majority of functions won't come anywhere
> > > near that level of recursion.
> >
> > And BTW, supporting that further, the max recursion depth on vmlinux.o
> > on a defconfig kernel is showing 162.
>
> That's mostly immaterial - 'make allmodconfig' is not some esoteric
> test, it's one of the most common testing methods by developers and CI
> projects ... For example I use allmodconfig builds for every commit I
> write or apply.

FWIW, here are some numbers from a clang allmodconfig build:

vmlinux.o max recursion: 1,017

modules max recursion:
- mean: 69
- median: 41
- max: 7,165

--
Josh