lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140221101248.GB14653@mtj.dyndns.org>
Date:	Fri, 21 Feb 2014 05:12:48 -0500
From:	Tejun Heo <tj@...nel.org>
To:	Li Zefan <lizefan@...wei.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Cgroups <cgroups@...r.kernel.org>
Subject: Re: [PATCH v2] sysfs: fix namespace refcnt leak

On Fri, Feb 21, 2014 at 10:55:55AM +0800, Li Zefan wrote:
> As mount() and kill_sb() is not a one-to-one match, we shoudn't get
> ns refcnt unconditionally in sysfs_mount(), and instead we should
> get the refcnt only when kernfs_mount() allocated a new superblock.
> 
> v2:
> - Changed the name of the new argument, suggested by Tejun.
> - Made the argument optional, suggested by Tejun.
> 
> Signed-off-by: Li Zefan <lizefan@...wei.com>
...
> @@ -132,6 +132,7 @@ const void *kernfs_super_ns(struct super_block *sb)
>   * @flags: mount flags specified for the mount
>   * @root: kernfs_root of the hierarchy being mounted
>   * @ns: optional namespace tag of the mount
> + * @new_sb_created: tell the caller if we allocated a new superblock
>   *
>   * This is to be called from each kernfs user's file_system_type->mount()
>   * implementation, which should pass through the specified @fs_type and
> @@ -141,7 +142,8 @@ const void *kernfs_super_ns(struct super_block *sb)
>   * The return value can be passed to the vfs layer verbatim.
>   */
>  struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
> -			       struct kernfs_root *root, const void *ns)
> +			       struct kernfs_root *root, const void *ns,
> +			       bool *new_sb_created)

Oops, just one more thing.  Let's please put @new_sb_created before
@ns; otherwise, kernfs_mount_ns() and kernfs_mount() become really
confusing as we end up omitting the second-to-last param for the
latter instead of the last.

Other than that,

 Reviewed-by: Tejun Heo <tj@...nel.org>

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ