From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753708AbbIANId (ORCPT ); Tue, 1 Sep 2015 09:08:33 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:53212 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753106AbbIANIc (ORCPT ); Tue, 1 Sep 2015 09:08:32 -0400 Date: Tue, 1 Sep 2015 08:08:22 -0500 From: Felipe Balbi To: Sebastian Ott CC: Felipe Balbi , James Morris , , , , Linux OMAP Mailing List Subject: Re: [PATCH] security: device_cgroup: fix RCU lockdep splat Message-ID: <20150901130822.GA4728@saruman.tx.rr.com> Reply-To: References: <1441053629-31844-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" 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 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: > >=20 > > [ 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: > >=20 > > [ 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_star= t_write+0x8c/0xb0 > > [ 12.060954] #1: (&of->mutex){+.+.+.}, at: [] kernfs_fop_= write+0x50/0x1b8 > > [ 12.069085] #2: (s_active#30){++++.+}, at: [] kernfs_fop= _write+0x58/0x1b8 > > [ 12.077310] #3: (devcgroup_mutex){+.+...}, at: [] devcgr= oup_access_write+0x20/0x658 > > [ 12.086575] stack backtrace: > > [ 12.091124] CPU: 0 PID: 1 Comm: systemd Not tainted 4.2.0-next-20150= 831 #1154 > > [ 12.098609] Hardware name: Generic AM43 (Flattened Device Tree) > > [ 12.104807] [] (unwind_backtrace) from [] (show_= stack+0x10/0x14) > > [ 12.112924] [] (show_stack) from [] (dump_stack+= 0x84/0x9c) > > [ 12.120491] [] (dump_stack) from [] (verify_new_= ex+0xc4/0xdc) > > [ 12.128326] [] (verify_new_ex) from [] (devcgrou= p_access_write+0x374/0x658) > > [ 12.137426] [] (devcgroup_access_write) from [] = (cgroup_file_write+0x28/0x1bc) > > [ 12.146796] [] (cgroup_file_write) from [] (kern= fs_fop_write+0xc0/0x1b8) > > [ 12.155620] [] (kernfs_fop_write) from [] (__vfs= _write+0x1c/0xd8) > > [ 12.163783] [] (__vfs_write) from [] (vfs_write+= 0x90/0x16c) > > [ 12.171426] [] (vfs_write) from [] (SyS_write+0x= 44/0x9c) > > [ 12.178806] [] (SyS_write) from [] (ret_fast_sys= call+0x0/0x1c) > >=20 > > Fix it by making sure rcu_read_lock() is held > > around devcgroup_update_access(). >=20 > With this patch applied I got the following: >=20 > [ 4.079102] BUG: sleeping function called from invalid context at mm/s= lub.c:1266 > [ 4.079105] in_atomic(): 0, irqs_disabled(): 0, pid: 1, name: systemd that didn't trigger here. maybe I didn't have lock debugging enabled. I'll have a look. --=20 balbi --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV5aNGAAoJEIaOsuA1yqRE/vYP/irPqXndibyLB0WUYoWY8rk6 lxZbt0kS0uBekMSghzk5lMHgFMpXzZRWGB6mBtz4MeQobRvHi2n2LhGXFrIt+Iyv FyjXnXy0OGLzIqzvThe+lb9ptzRXZzdjWDAOg626XUEdHUsWE5BKBHY1lvDH0rzq S+sqErFbYMerKmL6HWF2IJRadkXFeuhAVQ5HelyI6/0qVCF0O23P06iB58f0gQmB 68s3aVv4FoOGTtdyHmbEUXdfHtUImLYsBUP26Moj1rup3agPLIXkpnNo4X9c71bl SV02Z0FSQtQq/64bgw0nDSy+sv+QvtTcYyDYAuXwRbxUJWRgMIicXyQ8n/4x4lFw KXTjxj2EMfuLaDI1Y5AAM97f5JnbrmpP2+4arDir7rCxb08nyg//LZVKopkwv01q jyxuGGfH4yr+lF6pcM8kW9tO8BdkxLrzvvfwafFAgz11w1HVcBUMYYV2s0Oy0fNs Guux8M7Fa1ikzwe6cZzrmsilSpiA9imUkHlIS22znACdg0B+hwKdnSE4UaU6gPFU 0SBxvxXH8WHwIlSd1tHjl7Ib+i84oGQi/qs6PurLoGY2EN0XqYXKqj1buOlWC2Zg OtL2IpqIsa8YraKsbV7hdRHayph8OlxDg6+M0qHxfzfKypgvDUc7K6bV+mFPGZN7 nIxIBWgl7nFsUUXUcqWs =0uQl -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc--