Re: [PATCH net-next v7 2/2] binder: report txn errors via generic netlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +/**
> > + * binder_genl_init() - initialize binder generic netlink
> > + * @family:  the generic netlink family
> > + * @name:    the binder device name
> > + *
> > + * Registers the binder generic netlink family.
> > + */
> > +int binder_genl_init(struct genl_family *family, const char *name)
> > +{
> > +     int ret;
> > +
> > +     memcpy(family, &binder_genl_nl_family, sizeof(*family));
> > +     strscpy(family->name, name, GENL_NAMSIZ);
>
> You're trying to register multiple families with different names?
> The family defines the language / protocol. If you have multiple
> entities to multiplex you should do that based on attributes inside
> the messages.
>

My initial plan was to use a single "binder" family, which was more
straightforward and cleaner. As Android uses multiple binder contexts
to isolate system framework and vendor domains[1], Grek KH suggested
the netlink messages from different binder contexts should also be
isolated for security reason[2]. Personally I'm fine with either
approach. Please kindly advice which implementation is better.

And I'll fix other issues you mentioned above.

[1]
https://source.android.com/docs/core/architecture/hidl/binder-ipc

[2]
https://lore.kernel.org/lkml/2024081350-establish-direness-38ee@gregkh/

> > +     ret = genl_register_family(family);
> > +     if (ret) {
> > +             pr_err("Failed to register binder genl: %s\n", name);
> > +             return ret;
> > +     }
> > +
> > +     return 0;
> > +}
>




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux