From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755188AbbIBQYy (ORCPT ); Wed, 2 Sep 2015 12:24:54 -0400 Received: from mail-yk0-f171.google.com ([209.85.160.171]:34652 "EHLO mail-yk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754958AbbIBQYw (ORCPT ); Wed, 2 Sep 2015 12:24:52 -0400 Date: Wed, 2 Sep 2015 12:24:50 -0400 From: Tejun Heo To: Felipe Balbi Cc: James Morris , serge@hallyn.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Linux OMAP Mailing List , "Paul E. McKenney" Subject: Re: [PATCH v2] security: device_cgroup: fix RCU lockdep splat Message-ID: <20150902162450.GJ22326@mtj.duckdns.org> References: <20150902125608.GA8299@saruman.tx.rr.com> <1441199548-29633-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441199548-29633-1-git-send-email-balbi@ti.com> 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 cc'ing Paul. On Wed, Sep 02, 2015 at 08:12:28AM -0500, Felipe Balbi wrote: > while booting AM437x device, the following splat > triggered: > > [ 12.005238] =============================== > [ 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.128326] [] (verify_new_ex) from [] (devcgroup_access_write+0x374/0x658) > [ 12.137426] [] (devcgroup_access_write) from [] (cgroup_file_write+0x28/0x1bc) > [ 12.146796] [] (cgroup_file_write) from [] (kernfs_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+0x44/0x9c) > [ 12.178806] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x1c) This shouldn't be happening because devcgroup_access_write() always grabs devcgroup_mutex. Looking at the log, the culprit seems to be f78f5b90c4ff ("rcu: Rename rcu_lockdep_assert() to RCU_LOCKDEP_WARN()"). It missed the bang for the second test while inverting it, so adding rcu_read_lock() isn't the right fix here. Paul, can you please fix it? Thanks. -- tejun