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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130516175017.GA7171@mtj.dyndns.org>
Date:	Thu, 16 May 2013 10:50:17 -0700
From:	Tejun Heo <tj@...nel.org>
To:	Chen Gang <gang.chen@...anux.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel/workqueue.c: need call device_remove_file() when
 failure occurs after called device_create_file()

Hey,

On Thu, May 16, 2013 at 12:48:43PM +0800, Chen Gang wrote:
> __sysfs_remove_dir() remove all related things, but not deref the count.
> 
> For __sysfs_remove_dir() ->
>   ...
>   sysfs_addrm_start()
>   ...
>   while() {
>     ...
>     sysfs_remove_one()  (not deref the related file)
>   }
>   sysfs_addrm_finish()  (will deref current dir)
> 
> For device_remove_file() ->
>   sysfs_remove_file() ->
>     sysfs_hash_and_remove() ->
>       ...
>       sysfs_addrm_start()
>       ...
>       sysfs_remove_one() (not deref the current file)
>       sysfs_addrm_finish()  (will deref current file)
> 
> 
> So if not call device_remove_file() firstly, the all files under the
> directory are removed, but the related resources are not released which
> will cause resource leak.

Can you please be more specific on what gets leaked and if possible
fix it from sysfs side?

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