From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754695AbbIBM4U (ORCPT ); Wed, 2 Sep 2015 08:56:20 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:48517 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754511AbbIBM4R (ORCPT ); Wed, 2 Sep 2015 08:56:17 -0400 Date: Wed, 2 Sep 2015 07:56:08 -0500 From: Felipe Balbi To: Josh Boyer CC: Felipe Balbi , Sebastian Ott , James Morris , "Serge E. Hallyn" , linux-security-module , "Linux-Kernel@Vger. Kernel. Org" , Linux OMAP Mailing List Subject: Re: [PATCH] security: device_cgroup: fix RCU lockdep splat Message-ID: <20150902125608.GA8299@saruman.tx.rr.com> Reply-To: References: <1441053629-31844-1-git-send-email-balbi@ti.com> <20150901130822.GA4728@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 02, 2015 at 08:29:14AM -0400, Josh Boyer wrote: > On Tue, Sep 1, 2015 at 9:08 AM, Felipe Balbi wrote: > > On Tue, Sep 01, 2015 at 11:12:18AM +0200, Sebastian Ott wrote: > >> On Mon, 31 Aug 2015, Felipe Balbi wrote: > >> > while booting AM437x device, the following splat > >> > triggered: > >> > > >> > [ 12.005238] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> > [ 12.009749] [ INFO: suspicious RCU usage. ] > >> > [ 12.014116] 4.2.0-next-20150831 #1154 Not tainted > >> > [ 12.019050] ------------------------------- > >> > [ 12.023408] security/device_cgroup.c:405 device_cgroup:verify_new= _ex called without proper synchronization! > >> > [ 12.033576] other info that might help us debug this: > >> > > >> > [ 12.041942] rcu_scheduler_active =3D 1, debug_locks =3D 0 > >> > [ 12.048796] 4 locks held by systemd/1: > >> > [ 12.052700] #0: (sb_writers#7){.+.+.+}, at: [] __sb_s= tart_write+0x8c/0xb0 > >> > [ 12.060954] #1: (&of->mutex){+.+.+.}, at: [] kernfs_f= op_write+0x50/0x1b8 > >> > [ 12.069085] #2: (s_active#30){++++.+}, at: [] kernfs_= fop_write+0x58/0x1b8 > >> > [ 12.077310] #3: (devcgroup_mutex){+.+...}, at: [] dev= cgroup_access_write+0x20/0x658 > >> > [ 12.086575] stack backtrace: > >> > [ 12.091124] CPU: 0 PID: 1 Comm: systemd Not tainted 4.2.0-next-20= 150831 #1154 > >> > [ 12.098609] Hardware name: Generic AM43 (Flattened Device Tree) > >> > [ 12.104807] [] (unwind_backtrace) from [] (sh= ow_stack+0x10/0x14) > >> > [ 12.112924] [] (show_stack) from [] (dump_sta= ck+0x84/0x9c) > >> > [ 12.120491] [] (dump_stack) from [] (verify_n= ew_ex+0xc4/0xdc) > >> > [ 12.128326] [] (verify_new_ex) from [] (devcg= roup_access_write+0x374/0x658) > >> > [ 12.137426] [] (devcgroup_access_write) from [] (cgroup_file_write+0x28/0x1bc) > >> > [ 12.146796] [] (cgroup_file_write) from [] (k= ernfs_fop_write+0xc0/0x1b8) > >> > [ 12.155620] [] (kernfs_fop_write) from [] (__= vfs_write+0x1c/0xd8) > >> > [ 12.163783] [] (__vfs_write) from [] (vfs_wri= te+0x90/0x16c) > >> > [ 12.171426] [] (vfs_write) from [] (SyS_write= +0x44/0x9c) > >> > [ 12.178806] [] (SyS_write) from [] (ret_fast_= syscall+0x0/0x1c) > >> > > >> > Fix it by making sure rcu_read_lock() is held > >> > around devcgroup_update_access(). > >> > >> With this patch applied I got the following: > >> > >> [ 4.079102] BUG: sleeping function called from invalid context at m= m/slub.c:1266 > >> [ 4.079105] in_atomic(): 0, irqs_disabled(): 0, pid: 1, name: syste= md > > > > that didn't trigger here. maybe I didn't have lock debugging enabled. > > I'll have a look. >=20 > Did you happen to get a chance to poke further? I'm seeing the > original splat on all my machines as well. in today's TODO. --=20 balbi --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV5vHoAAoJEIaOsuA1yqREWTAP/1pOuXxYXRZenMSiTeQagcn6 wP4ZxneSmpnPb+1zfnws3DcILK7GDnv6CkrfUxOIxVMj/zAbwRXZMXROnXQSqNVM hRmrcd1kXD7iDC8XRjH3DO28vNc76rWxx2ObocAx/XiLRgzUSJKkzMSAbytER9cp PlOcfkDvGsgBGJZ0jXE8EoUmS3V8PEpbDLbSjJ7Kb4eexLidEYZWgy+lnHOxhlLs Qu+s/X/pKGQY8ol7lAcqzwUjY8+8LxKLldYw7CHKVxb9IRsOE3evmWUuPn4PS0xc DAPNQxzedNV0T6dMKC4zH1Mx6yshmhaqzU/lCvQDSZGm/v8h0WYBlT1oaW/1Bl1A 2GuEXPUzB0FbNeBol4MGsarxybURWKMbJ0+/zeCWff14gH7Mht61D1MIcc8MKSap GK0MMcCV2jSfYY1pAyhJxzYO1IGEMHRHD6bJPTGaz5nkIONMq5N1Iv0BkUDH5t3w Rq9bu4tzre6x8SvGHSZ4W2m264Y0deT5s3aT5p6oRxMJXhxIQRyfB7y9adZT9CzZ Oo7oEtHNomY3geVA6Kxzlt0uYQdjwjQx/JBIDizbne/i0XsAN3+NOl7LVOkGgArJ zQW62R/ucacpYEQiQHUUvQjafqR+VjLu/8btaSq1QkmZzVpuQZfYnj5EkdL2jhpI uFIOd7UgjTesZ0sjjRN5 =GxT8 -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--