Received: by 10.223.185.116 with SMTP id b49csp1040935wrg; Fri, 16 Feb 2018 11:18:48 -0800 (PST) X-Google-Smtp-Source: AH8x227hy2acoKHpIFVo/SlXR4W+T4jJFz6BxqDE8K6Xysk7dvMDDTbv7NTGDzQY9RzIch+w12IN X-Received: by 10.98.7.214 with SMTP id 83mr6946658pfh.130.1518808728804; Fri, 16 Feb 2018 11:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518808728; cv=none; d=google.com; s=arc-20160816; b=p4YJLQY9tchm6cu4tn+I1Dlzz1mAxzc8aO/KMwLiUlwqu21ViwD5ybjRFOrATgwSKH WFtvWdD/evhUazx86nIuAqmDt4L07vLa35eOk2nve3fKM7mDpHItZremtrM20mm7KAnV fntQ128qm54dVFTVl7a/sAUtdy0A7CH8C4oO8cj4pSSOpgGU4vf1pg5+Zfsma2iH3oAE jwxyDJu7cM7gfsvnkEHvjay9lAOCfMGPTWS42ApeHghgqvhfFSUGyNiV3zqsKnC0pon9 VS0V1JMSqDNBLoM0ISkM0OLDzYEhLwRHSTWGUcIY9p0MSJfVL9zYhMCnmmvoTyvoL/dk 3zRQ== 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=kT9dQKtRnKtX8xR8m02NvyVG6QW+fYpJNeq6ZSUBkw8=; b=M2thaM9eM/FEDP8klSrx0isHKP7MPCvkDqRlhIGfXDOzwpMJGim71fIxeLjZickeZh id+pZljRtYlt1HtJaB34DWTj8Hik5W93EEs3HRvUy5bgTpga/qQSmqAcG/vop6s4LTNm gGaKvSpQV4iVoOkzk7HH2d8yMTaM1zoLaoIU41coEesrxrcDKeWd/Ro/9u1ZMvDe/S+s NV4hCWHDK+C8Gyi77tYelVPd7G+MEEVgdR/vS+2g3I4d2D7Mknwtde84bfm3xjMvgRoO o7PorSouOVqfcrvrKY8A+KYDCZZONhcT4Il7SYmw8Oahi9OvHwh8CU884gyHWwupSSHq 5sIQ== 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 r5-v6si1851707plo.443.2018.02.16.11.18.34; Fri, 16 Feb 2018 11:18:48 -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 S1032151AbeBPQc6 (ORCPT + 99 others); Fri, 16 Feb 2018 11:32:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52498 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031831AbeBPQc5 (ORCPT ); Fri, 16 Feb 2018 11:32:57 -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 7A2A7ED4; Fri, 16 Feb 2018 16:32:56 +0000 (UTC) Date: Fri, 16 Feb 2018 17:32:57 +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] staging: ashmem: Fix lockdep issue during llseek Message-ID: <20180216163257.GA7752@kroah.com> References: <20180213010125.174811-1-joelaf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180213010125.174811-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 Mon, Feb 12, 2018 at 05:01:25PM -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 > --- > drivers/staging/android/ashmem.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) Please always properly version your patches, and put what changed below the --- line, so I have a hint as to which patch to apply. Documentation/SubmittingPatches has the full details of how to do this. Can you resend me the "latest" version of this patch, so I have a chance of getting it right? :) thanks, greg k-h