]> git.baikalelectronics.ru Git - kernel.git/commit
binderfs: respect limit on binder control creation
authorChristian Brauner <christian@brauner.io>
Wed, 23 Jan 2019 11:41:15 +0000 (12:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2019 14:23:48 +0000 (15:23 +0100)
commit9dd4dcd81c1ceed6ae44bb0a996d6e0d25b87970
tree57e78c53fb1f3f539a5cfa6fd5dd896f10e051c5
parentfd34741cd131bf01d96c20e44a8cb87bb18c4f0b
binderfs: respect limit on binder control creation

We currently adhere to the reserved devices limit when creating new
binderfs devices in binderfs instances not located in the inital ipc
namespace. But it is still possible to rob the host instances of their 4
reserved devices by creating the maximum allowed number of devices in a
single binderfs instance located in a non-initial ipc namespace and then
mounting 4 separate binderfs instances in non-initial ipc namespaces. That
happens because the limit is currently not respected for the creation of
the initial binder-control device node. Block this nonsense by performing
the same check in binderfs_binder_ctl_create() that we perform in
binderfs_binder_device_create().

Fixes: 19d26c888ac0 ("binderfs: reserve devices for initial mount")
Signed-off-by: Christian Brauner <christian@brauner.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binderfs.c