Re: [PATCH v13 1/3] tools: ynl-gen: add trampolines for sock-priv

From: Jakub Kicinski
Date: Wed Jan 15 2025 - 12:12:06 EST


On Wed, 15 Jan 2025 08:44:37 -0800 Li Li wrote:
> On Wed, Jan 15, 2025 at 8:13 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> >
> > On Wed, 15 Jan 2025 02:29:48 -0800 Li Li wrote:
> > > From: Li Li <dualli@xxxxxxxxxx>
> > >
> > > This fixes the CFI failure at genl-sk_priv_get().
> > >
> > > Suggested-by: Jakub Kicinski <kuba@xxxxxxxxxx>
> > > Signed-off-by: Li Li <dualli@xxxxxxxxxx>
> >
> > No, no, this is a fix. We'll try to send it to Linus tomorrow.
>
> Thank you for prioritizing the fix!
>
> There's another trivial issue which I just realized after sending out the
> patchset. When "sock-priv" is a pointer (like the example below), ynl-gen
> generates ugly code and fails scripts/checkpatch.
>
> Should I use typedef instead although it seems discouraged according to
> https://www.kernel.org/doc/html/latest/process/coding-style.html?
>
> YAML:
> + sock-priv: struct binder_context *

We can adjust that later, but I think cleanest fix may be to wrap the
priv in a separate struct, even if it only has one member.