Re: [REGRESSION] module BTF validation failure (Error -22) on next

From: Uros Bizjak
Date: Thu Dec 05 2024 - 05:36:08 EST


On Thu, Dec 5, 2024 at 11:33 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
>
> On Wed, Dec 04, 2024 at 04:53:05PM +0100, Laura Nao wrote:
> > On 11/15/24 18:17, Laura Nao wrote:
> > > I managed to reproduce the issue locally and I've uploaded the vmlinux[1]
> > > (stripped of DWARF data) and vmlinux.raw[2] files, as well as one of the
> > > modules[3] and its btf data[4] extracted with:
> > >
> > > bpftool -B vmlinux btf dump file cros_kbd_led_backlight.ko > cros_kbd_led_backlight.ko.raw
> > >
> > > Looking again at the logs[5], I've noticed the following is reported:
> > >
> > > [ 0.415885] BPF: type_id=115803 offset=177920 size=1152
> > > [ 0.416029] BPF:
> > > [ 0.416083] BPF: Invalid offset
> > > [ 0.416165] BPF:
> > >
> > > There are two different definitions of rcu_data in '.data..percpu', one
> > > is a struct and the other is an integer:
> > >
> > > type_id=115801 offset=177920 size=1152 (VAR 'rcu_data')
> > > type_id=115803 offset=177920 size=1152 (VAR 'rcu_data')
> > >
> > > [115801] VAR 'rcu_data' type_id=115572, linkage=static
> > > [115803] VAR 'rcu_data' type_id=1, linkage=static
> > >
> > > [115572] STRUCT 'rcu_data' size=1152 vlen=69
> > > [1] INT 'long unsigned int' size=8 bits_offset=0 nr_bits=64 encoding=(none)
> > >
> > > I assume that's not expected, correct?
> > >
> > > I'll dig a bit deeper and report back if I can find anything else.
> >
> > I ran a bisection, and it appears the culprit commit is:
> > https://lore.kernel.org/all/20241021080856.48746-2-ubizjak@xxxxxxxxx/
>
> which tree are you using, I can't see this in linu-next ?

The offending commit is now part of linus tree:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=001217defda86d0d6a5a9e6cf77a6b813857e7e3

Uros.