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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Jan 2014 15:19:51 -0200
From:	Fabio Estevam <festevam@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Denis Kirjanov <kda@...ux-powerpc.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	USB list <linux-usb@...r.kernel.org>
Subject: Re: [PATCH driver-core-linus] kernfs: make kernfs_deactivate() honor
 KERNFS_LOCKDEP flag

On Wed, Jan 29, 2014 at 3:04 PM, Tejun Heo <tj@...nel.org> wrote:
> kernfs_deactivate() forgot to check whether KERNFS_LOCKDEP is set
> before performing lockdep annotations and ends up feeding
> uninitialized lockdep_map to lockdep triggering warning like the
> following on USB stick hotunplug.
>
>  usb 1-2: USB disconnect, device number 2
>  INFO: trying to register non-static key.
>  the code is fine but needs lockdep annotation.
>  turning off the locking correctness validator.
>  CPU: 1 PID: 62 Comm: khubd Not tainted 3.13.0-work+ #82
>  Hardware name: empty empty/S3992, BIOS 080011  10/26/2007
>   ffff880065ca7f60 ffff88013a4ffa08 ffffffff81cfb6bd 0000000000000002
>   ffff88013a4ffac8 ffffffff810f8530 ffff88013a4fc710 0000000000000002
>   ffff880100000000 ffffffff82a3db50 0000000000000001 ffff88013a4fc710
>  Call Trace:
>   [<ffffffff81cfb6bd>] dump_stack+0x4e/0x7a
>   [<ffffffff810f8530>] __lock_acquire+0x1910/0x1e70
>   [<ffffffff810f931a>] lock_acquire+0x9a/0x1d0
>   [<ffffffff8127c75e>] kernfs_deactivate+0xee/0x130
>   [<ffffffff8127d4c8>] kernfs_addrm_finish+0x38/0x60
>   [<ffffffff8127d701>] kernfs_remove_by_name_ns+0x51/0xa0
>   [<ffffffff8127b4f1>] remove_files.isra.1+0x41/0x80
>   [<ffffffff8127b7e7>] sysfs_remove_group+0x47/0xa0
>   [<ffffffff8127b873>] sysfs_remove_groups+0x33/0x50
>   [<ffffffff8177d66d>] device_remove_attrs+0x4d/0x80
>   [<ffffffff8177e25e>] device_del+0x12e/0x1d0
>   [<ffffffff819722c2>] usb_disconnect+0x122/0x1a0
>   [<ffffffff819749b5>] hub_thread+0x3c5/0x1290
>   [<ffffffff810c6a6d>] kthread+0xed/0x110
>   [<ffffffff81d0a56c>] ret_from_fork+0x7c/0xb0
>
> Fix it by making kernfs_deactivate() perform lockdep annotations only
> if KERNFS_LOCKDEP is set.
>
> Signed-off-by: Tejun Heo <tj@...nel.org>
> Reported-by: Fabio Estevam <festevam@...il.com>
> Reported-by: Alan Stern <stern@...land.harvard.edu>

Thanks, Tejun. I don't get the warning after removing the USB stick
after applying this patch:

Tested-by: Fabio Estevam <fabio.estevam@...escale.com>
--
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