Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752332AbbHQRXe (ORCPT ); Mon, 17 Aug 2015 13:23:34 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:34328 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbbHQRXc convert rfc822-to-8bit (ORCPT ); Mon, 17 Aug 2015 13:23:32 -0400 MIME-Version: 1.0 In-Reply-To: <1439558503-1749-1-git-send-email-lkundrak@v3.sk> References: <877fozw4bo.fsf@x220.int.ebiederm.org> <1439558503-1749-1-git-send-email-lkundrak@v3.sk> Date: Mon, 17 Aug 2015 19:23:30 +0200 Message-ID: Subject: Re: [PATCH] kdbus: create /sys/fs/kdbus with sysfs_create_mount_point() From: David Herrmann To: Lubomir Rintel Cc: Greg Kroah-Hartman , Daniel Mack , David Herrmann , Djalal Harouni , linux-kernel , "Eric W. Biederman" , linux-fsdevel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2076 Lines: 72 Hi On Fri, Aug 14, 2015 at 3:21 PM, Lubomir Rintel wrote: > Since 0cbee99269 user-namespace pull, if a kdbusfs is mounted on a > location that's not created with sysfs_create_mount_point the user > namespaces are not allowed to mount their sysfs instances. > > Signed-off-by: Lubomir Rintel > --- > Applies on top of char-misc/kdbus a36324913. This does not apply on top of char-misc/kdbus. The tree lacks the necessary commits. But yeah, it's required for 4.2. I'll keep it starred until Greg back-merges 4.2. Anyway, this is still: Reviewed-by: David Herrmann Thanks! David > ipc/kdbus/main.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/ipc/kdbus/main.c b/ipc/kdbus/main.c > index 1ad4dc8..c2117ea 100644 > --- a/ipc/kdbus/main.c > +++ b/ipc/kdbus/main.c > @@ -75,16 +75,13 @@ > * 'ยป struct kdbus_ep *ep (owned) > */ > > -/* kdbus mount-point /sys/fs/kdbus */ > -static struct kobject *kdbus_dir; > - > static int __init kdbus_init(void) > { > int ret; > > - kdbus_dir = kobject_create_and_add(KBUILD_MODNAME, fs_kobj); > - if (!kdbus_dir) > - return -ENOMEM; > + ret = sysfs_create_mount_point(fs_kobj, KBUILD_MODNAME); > + if (ret) > + return ret; > > ret = kdbus_fs_init(); > if (ret < 0) { > @@ -96,14 +93,14 @@ static int __init kdbus_init(void) > return 0; > > exit_dir: > - kobject_put(kdbus_dir); > + sysfs_remove_mount_point(fs_kobj, KBUILD_MODNAME); > return ret; > } > > static void __exit kdbus_exit(void) > { > kdbus_fs_exit(); > - kobject_put(kdbus_dir); > + sysfs_remove_mount_point(fs_kobj, KBUILD_MODNAME); > ida_destroy(&kdbus_node_ida); > } > > -- > 2.4.3 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/