Received: by 10.223.185.116 with SMTP id b49csp1043824wrg; Fri, 16 Feb 2018 11:22:21 -0800 (PST) X-Google-Smtp-Source: AH8x224RBMeqph6DAph80SiE4tfi750CxplqA+CBiaLIFkPAvZ6fWnU4x3aN1x5gxrRzchAtnBsD X-Received: by 10.99.97.81 with SMTP id v78mr5973323pgb.243.1518808941253; Fri, 16 Feb 2018 11:22:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518808941; cv=none; d=google.com; s=arc-20160816; b=y2CHi4xWE+nTejiDBnhAgK8pC0rEMTkzki7Mal5qBxKQO7TWXU7ZncDI3jvMuIi/sX cMQ0YqVtDi+0NE8wgVRxOkOQ0uDZqR+6queFgZJbILpgp/KwNQx5+oYdiIWhTmmyKLec hScoGuUr9KbayDYCqnacOpkhrSbJ9CWklG5bOW5tGOlgds8Ic4D213lAVmoWfMq3an3v c4qhJbVzVFnfcoxANITSMd0Zb5zVVVcPRsbT1AjHro+5IlsQahty3Z1wakrBjbaJ7Dh0 yBwjRi7sd12ckPEDLwr84aevRhXRatxbUTHy6uK1kztfKExjFJ2Q+icuOCmuwmmCL3K7 KyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=LsEuHEVAI0xxwbxQ57hbUWBv30typLy1G0+ORoNWzhM=; b=Y+T08wVab2/3zZ2FR8Q+3ZSJTYX8FD4ATGGk/mp9bUGgGTZ0RAg8e/t8DZG+nt/uE1 a+ko0kM9vow2ZdDJRCaeLChVSllvDpWlWUINHlKO064t2EJm3CtS5XZhUtC8RgORxQ0n m1ScTmPOlxhJKCGuUsyP8PqV8XI2hKB+WWSxhstU1MNzW+wCwUSFHNof/nX0SdrbIMx1 3DYXMFpIfoZX8VGwFeh+al1cfkG7OGFEKN8yYDglqXQP9TVRXwqZIWXd/O7DOtq4we45 EzgD2K5OycW1TjynLoLhqhxhCX3yc81Qun8x6GPtECMNZhEMI3kImQIe4y2qEGseWZtt nAew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ERtFEi37; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si6374497ple.154.2018.02.16.11.22.06; Fri, 16 Feb 2018 11:22:21 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=ERtFEi37; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162212AbeBPRiC (ORCPT + 99 others); Fri, 16 Feb 2018 12:38:02 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:41396 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162198AbeBPRiB (ORCPT ); Fri, 16 Feb 2018 12:38:01 -0500 Received: by mail-io0-f194.google.com with SMTP id e4so4869386iob.8 for ; Fri, 16 Feb 2018 09:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LsEuHEVAI0xxwbxQ57hbUWBv30typLy1G0+ORoNWzhM=; b=ERtFEi37hxfqFyHBj5x8DxQbF1Hzf40lI/LM3SwtvXevHj5jR6X+GLmZqKIQe+MLHi 22p1DOMd0o471l95tnGUTCfpjg6AFf52Sq+HjplWKZN78lhqpCUxGRW/l5vj3kIg0P6i 1TPE8TC1oZjpm6Ik6zHu72K1v0kMjByDEYlvkGf+tg4LrSthR9+Zk4yp5poU1TrGTzXU Uyt39z31+cJMNX8PitIhlNXJM3oKe3AOH9FMpMq/k2wFxOK2ros/ut31qXSUtwqKKmlF cZaxTwH03kXMqkYbie/KQo+AxCKQbQtt5fncqeUpb5iBsoQSyrPjuIA5M3RooKzK4SYT Hdew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LsEuHEVAI0xxwbxQ57hbUWBv30typLy1G0+ORoNWzhM=; b=ZiRpBzmk3nCb3tJQN6z+vqirX0hZvSLkZIdYZROJMZ3RvVwMrkKuAnUYX2MZwvyIkT o6NBz5sOUTttL5Df+ZzqWCT4AkgLuwYi6VDax3cxhnF4afxMsHUZN81YDhnhn7qDIXUv XHzKq6bHmoBebnVhxBWPGbcosqklwtcud9UGZDJKm9/T+zcb2kjBzupwjbLDWQiME2O8 CQjQPauzDS/RzjZUGd4yRlxqQXt3xj5d8rv8qOqsgUt7Mlmcz+8NzTXdqzOOrOW7eFTu 463BBqSKO7KA/diXdPlbkktAoipOy+9TetU9G/IPZwdp0PH78hfgDkQm3TZrIRh0YlTD myUg== X-Gm-Message-State: APf1xPCXtZs6GwcMBQazKmpAjNo/pngyc4p0E9VMdOEfxGz0pfv5KsoA dbDcCVlKzIgdUiaM7CAvIloYAC69rEZEI1HLlZIK7SuPCfs= X-Received: by 10.107.131.218 with SMTP id n87mr9644525ioi.268.1518802679973; Fri, 16 Feb 2018 09:37:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.107.8 with HTTP; Fri, 16 Feb 2018 09:37:59 -0800 (PST) In-Reply-To: <20180216163257.GA7752@kroah.com> References: <20180213010125.174811-1-joelaf@google.com> <20180216163257.GA7752@kroah.com> From: Joel Fernandes Date: Fri, 16 Feb 2018 09:37:59 -0800 Message-ID: Subject: Re: [PATCH] staging: ashmem: Fix lockdep issue during llseek To: Greg Kroah-Hartman Cc: LKML , Todd Kjos , Arve Hjonnevag , Greg Hackmann , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 8:32 AM, Greg Kroah-Hartman wrote: > 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? :) Sorry about that :) Fixing now, and will resend. This version you're replying to is the latest version which is the second version (v2). - Joel