linux-uconsole/drivers/android
Christian Brauner 65d2e4cb02 UPSTREAM: binderfs: prevent renaming the control dentry
- make binderfs control dentry immutable:
  We don't allow to unlink it since it is crucial for binderfs to be
  useable but if we allow to rename it we make the unlink trivial to
  bypass. So prevent renaming too and simply treat the control dentry as
  immutable.

- add is_binderfs_control_device() helper:
  Take the opportunity and turn the check for the control dentry into a
  separate helper is_binderfs_control_device() since it's now used in two
  places.

- simplify binderfs_rename():
  Instead of hand-rolling our custom version of simple_rename() just dumb
  the whole function down to first check whether we're trying to rename the
  control dentry. If we do EPERM the caller and if not call simple_rename().

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christian Brauner <christian@brauner.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 136497735
(cherry picked from commit e98e6fa186)
Change-Id: I44e49a144b624c360ab8a277970625c64511da15
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2019-12-08 21:43:43 -08:00
..
binder.c UPSTREAM: binder: implement binderfs 2019-12-08 21:41:34 -08:00
binder_alloc.c binder: fix race between munmap() and direct reclaim 2019-06-09 09:17:23 +02:00
binder_alloc.h BACKPORT: binder: use userspace pointer as base of buffer space 2019-03-25 15:08:18 -07:00
binder_alloc_selftest.c UPSTREAM: binder: fix sparse issue in binder_alloc_selftest.c 2019-03-25 15:08:19 -07:00
binder_internal.h UPSTREAM: binder: implement binderfs 2019-12-08 21:41:34 -08:00
binder_trace.h BACKPORT: binder: use userspace pointer as base of buffer space 2019-03-25 15:08:18 -07:00
binderfs.c UPSTREAM: binderfs: prevent renaming the control dentry 2019-12-08 21:43:43 -08:00
Kconfig UPSTREAM: binder: implement binderfs 2019-12-08 21:41:34 -08:00
Makefile UPSTREAM: binder: implement binderfs 2019-12-08 21:41:34 -08:00