netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] binder: report txn errors via generic netlink (genl)
@ 2024-10-11  6:44 Li Li
  2024-10-11  6:44 ` [PATCH v2 1/1] binder: report txn errors via generic netlink Li Li
  0 siblings, 1 reply; 5+ messages in thread
From: Li Li @ 2024-10-11  6:44 UTC (permalink / raw)
  To: dualli, corbet, gregkh, arve, tkjos, maco, joel, brauner,
	cmllamas, surenb, arnd, masahiroy, devel, linux-kernel, netdev,
	hridya, smoreland
  Cc: kernel-team

From: Li Li <dualli@google.com>

It's a known issue that neither the frozen processes nor the system
administration process of the OS can correctly deal with failed binder
transactions. The reason is that there's no reliable way for the user
space administration process to fetch the binder errors from the kernel
binder driver.

Android is such an OS suffering from this issue. Since cgroup freezer
was used to freeze user applications to save battery, innocent frozen
apps have to be killed when they receive sync binder transactions or
when their async binder buffer is running out.

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 transactiions.

The first version uses a global generic netlink for all binder contexts,
raising potential security concerns. There were a few other feedbacks
like request to kernel docs and test code. The thread can be found at
https://lore.kernel.org/lkml/20240812211844.4107494-1-dualli@chromium.org/

This version fixes those issues and has been tested on the latest
version of AOSP. See https://r.android.com/3305462 for how userspace is
going to use this feature and the test code.

v1: add a global binder genl socket for all contexts
v2: change to per-context binder genl for security reason
    replace the new ioctl with a netlink command
    add corresponding doc Documentation/admin-guide/binder_genl.rst
    add user space test code in AOSP

Li Li (1):
  binder: report txn errors via generic netlink

 Documentation/admin-guide/binder_genl.rst |  69 ++++++
 drivers/android/Kconfig                   |   1 +
 drivers/android/Makefile                  |   2 +-
 drivers/android/binder.c                  |  82 ++++++-
 drivers/android/binder_genl.c             | 249 ++++++++++++++++++++++
 drivers/android/binder_internal.h         |  31 +++
 drivers/android/binder_trace.h            |  37 ++++
 drivers/android/binderfs.c                |   4 +
 include/uapi/linux/android/binder.h       | 132 ++++++++++++
 9 files changed, 603 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/admin-guide/binder_genl.rst
 create mode 100644 drivers/android/binder_genl.c

-- 
2.47.0.rc1.288.g06298d1525-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-11 16:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  6:44 [PATCH v2 0/1] binder: report txn errors via generic netlink (genl) Li Li
2024-10-11  6:44 ` [PATCH v2 1/1] binder: report txn errors via generic netlink Li Li
2024-10-11  6:51   ` Greg KH
2024-10-11  7:42     ` Li Li
2024-10-11 16:09   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).