Re: [PATCH v2 1/1] binder: report txn errors via generic netlink
From: Jakub Kicinski
Date: Fri Oct 11 2024 - 12:09:52 EST
On Thu, 10 Oct 2024 23:44:27 -0700 Li Li wrote:
> Frozen tasks can't process binder transactions, so sync binder
> transactions will fail with BR_FROZEN_REPLY and async binder
> transactions will be queued in the kernel async binder buffer.
> As these queued async transactions accumulates over time, the async
> buffer will eventually be running out, denying all new transactions
> after that with BR_FAILED_REPLY.
>
> In addition to the above cases, different kinds of binder error codes
> might be returned to the sender. However, the core Linux, or Android,
> system administration process never knows what's actually happening.
>
> This patch introduces the Linux generic netlink messages into the binder
> driver so that the Linux/Android system administration process can
> listen to important events and take corresponding actions, like stopping
> a broken app from attacking the OS by sending huge amount of spamming
> binder transactions.
>
> To prevent making the already bloated binder.c even bigger, a new source
> file binder_genl.c is created to host those generic netlink code.
Please add a YNL spec for the new family, and use it to codegen
the basics like policy and op tables:
https://docs.kernel.org/next/userspace-api/netlink/specs.html
Don't hesitate to ask if you have any questions.