• Christian Brauner's avatar
    binderfs: respect limit on binder control creation · da8ddba5
    Christian Brauner authored
    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: 36bdf3ca ("binderfs: reserve devices for initial mount")
    Signed-off-by: default avatarChristian Brauner <christian@brauner.io>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    da8ddba5
binderfs.c 14.2 KB