Re: [PATCH] samples/livepatch: Add BPF struct_ops integration sample
From: Song Liu
Date: Fri Apr 17 2026 - 11:45:35 EST
On Fri, Apr 17, 2026 at 12:45 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote:
>
> On Fri, Apr 17, 2026 at 12:33 AM Song Liu <song@xxxxxxxxxx> wrote:
> >
> > On Thu, Apr 16, 2026 at 12:46 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote:
> > [...]
> > > > +
> > > > +static struct klp_patch patch = {
> > > > + .mod = THIS_MODULE,
> > > > + .objs = objs,
> > >
> > > Nit: I suggest enabling the replace flag for this patch to align
> > > with the recommended implementation.
> > >
> > > .replace = true,
> >
> > This is an interesting topic. To fully take advantage of the replace
> > feature, we need more work on the BPF side.
>
> Right.
> Replacement seems to break struct_ops registration and BPF
> re-attachment. On the livepatch side, we should add support for the
> 'livepatch tag' to prevent these types of livepatches from being
> replaced ;)
I somehow knew you were gonna say this. :) But I don't think this
is a strong enough argument (and will probably scare folks more).
Thanks,
Song