Received: by 10.223.185.116 with SMTP id b49csp1942825wrg; Thu, 22 Feb 2018 05:49:50 -0800 (PST) X-Google-Smtp-Source: AH8x2272aRrTli6bRcMA97I5H1/Qg2cSiQR1Lf79EBAM5eDQa/qUCxaQCLUNtenkKP7TRui8YwS9 X-Received: by 2002:a17:902:5609:: with SMTP id h9-v6mr6629175pli.302.1519307390415; Thu, 22 Feb 2018 05:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519307390; cv=none; d=google.com; s=arc-20160816; b=qOKGUALIH1PQyR2gBU1fdMvtta3sPmhekBl1+KjffmW6ZH2h8yfNcSsTI0UtD0q7NM wUitMOgzIKM6xmnIN+U3bmPqude63EDt7MBDuoZhddRzgdpRSco5HpwqCykgTPianeGX M2tBsxCQA0Y2MaBRepN9eIGOf9QNGumzNP0bADpt4loUj1xSvJK+zqzLXWAe6agrzh/W fZX6ArhX7p7CRTjjL2jQvoKtRNs1XvEsnRTyQBe+jKlS5/3in+jnQElEjCMVHU6bw5iK G4Kvb5rdReRDoL1HQxow9/wJ7gC+wkIxbo+5b+lxvGpzQZe2Fjl2qxQj2jxd5hQqJudX qDlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=n1HtRBXa4k+zURa5N/bxP2AHSIoB5Mn23bInl3grk3s=; b=hbvO1p0TBDstAjcILUoxvVo2m/aarSLVEonphmiiiJ0PyPyrmTEi1eJUHVvBXCq4VV eBLDfQVPhEMJ9CwY1eao6y21S8K/dbHduBLaX5qiUZDRam/qsTc4QVPHpT4Nq3X+oIlo 8aXucg32HIJiTF7wBvJ7KpHMNJ2Cec4d8OMXM+QJZWrJwsWM6qAnuv/z4/ArBzOnkZPW U/OPiCLAHFSo5HxI8D5osVIbAcoD2B8BkKLA4JDNedZ5ntbRNzovwH5BTisLoAEx/pdE 9DYHSMuLCvDj0e0OzVebwJpvaimkUe5cR6IqrPYNRspJF9pWqvQLJywWKPogj1Tvy6he JUZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si60523pgr.172.2018.02.22.05.49.35; Thu, 22 Feb 2018 05:49:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932643AbeBVNsd (ORCPT + 99 others); Thu, 22 Feb 2018 08:48:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58920 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467AbeBVNsb (ORCPT ); Thu, 22 Feb 2018 08:48:31 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 19B2C10B0; Thu, 22 Feb 2018 13:48:30 +0000 (UTC) Date: Thu, 22 Feb 2018 14:48:32 +0100 From: Greg Kroah-Hartman To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Todd Kjos , Arve Hjonnevag , Greg Hackmann , stable@vger.kernel.org Subject: Re: [PATCH v2] staging: android: ashmem: Fix lockdep issue during llseek Message-ID: <20180222134832.GA1400@kroah.com> References: <20180216190201.59572-1-joelaf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180216190201.59572-1-joelaf@google.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 16, 2018 at 11:02:01AM -0800, Joel Fernandes wrote: > ashmem_mutex create a chain of dependencies like so: > > (1) > mmap syscall -> > mmap_sem -> (acquired) > ashmem_mmap > ashmem_mutex (try to acquire) > (block) > > (2) > llseek syscall -> > ashmem_llseek -> > ashmem_mutex -> (acquired) > inode_lock -> > inode->i_rwsem (try to acquire) > (block) > > (3) > getdents -> > iterate_dir -> > inode_lock -> > inode->i_rwsem (acquired) > copy_to_user -> > mmap_sem (try to acquire) > > There is a lock ordering created between mmap_sem and inode->i_rwsem > causing a lockdep splat [2] during a syzcaller test, this patch fixes > the issue by unlocking the mutex earlier. Functionally that's Ok since > we don't need to protect vfs_llseek. > > [1] https://patchwork.kernel.org/patch/10185031/ > [2] https://lkml.org/lkml/2018/1/10/48 > > Cc: Todd Kjos > Cc: Arve Hjonnevag > Cc: Greg Hackmann > Cc: Greg Kroah-Hartman > Cc: stable@vger.kernel.org > Reported-by: syzbot+8ec30bb7bf1a981a2012@syzkaller.appspotmail.com > Signed-off-by: Joel Fernandes > --- > Changes since first version: > Don't relock after vfs call since its not needed. Only reason we lock is > to protect races with asma->file. > https://patchwork.kernel.org/patch/10185031/ I'd like some acks from others before I take this patch. Joel, did the original reporter say this patch solved their issue or not? For some reason I didn't think it worked properly... thanks, greg k-h