From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39125 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbdAHPDS (ORCPT ); Sun, 8 Jan 2017 10:03:18 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id v08EwxtH139850 for ; Sun, 8 Jan 2017 10:03:18 -0500 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0a-001b2d01.pphosted.com with ESMTP id 27tw9uq098-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 08 Jan 2017 10:03:17 -0500 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Jan 2017 01:03:15 +1000 Subject: Re: xfs: commit 6552321831dc "xfs: remove i_iolock and use i_rwsem in the VFS inode instead" change causes hang From: Mimi Zohar To: Christoph Hellwig Cc: linux-xfs@vger.kernel.org, Dave Chinner , linux-fsdevel , linux-kernel , Al Viro Date: Sun, 08 Jan 2017 10:03:09 -0500 In-Reply-To: <20170108145200.GA29570@lst.de> References: <1483886924.8189.81.camel@linux.vnet.ibm.com> <20170108145200.GA29570@lst.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Message-Id: <1483887789.8189.90.camel@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, 2017-01-08 at 15:52 +0100, Christoph Hellwig wrote: > On Sun, Jan 08, 2017 at 09:48:44AM -0500, Mimi Zohar wrote: > > IMA takes the i_rwsem (fomerly i_mutex) before reading the file to > > synchronize calculating the file hash and validating the file's > > hash/signature stored as security.ima xattr > > Well, it shouldn't do that. In the I/O path i_rwsem is up to the > fs to use. Various other file systems also take it internally for > reads, although mostly only for direct I/O. But not normally for a normal file read. For direct I/O, IMA fails the file hash/signature verification, measurement, audit unless the IMA "permit_directio" rule is defined. > So the answer here is that ima needs to stop playing with i_rwsem. Unless something has changed recently, to synchronize reading files to calculate the file hash and writing xattrs it has to take the i_rwsem prior to reading the file. Mimi