Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3441840ybc; Thu, 21 Nov 2019 08:23:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyrlITaXqvomNEUsGLSmvpvCWVW20UxtYZlkawOBd0ZSd4RNt7a/S1j8iB2iG5Qit+Ba5oC X-Received: by 2002:a17:906:4a43:: with SMTP id a3mr14453772ejv.311.1574353383059; Thu, 21 Nov 2019 08:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574353383; cv=none; d=google.com; s=arc-20160816; b=AwpHwjyH1ZdMqrLFrTGLivpZf/dVI/PZxyNZnxfYhz66MMXA8QCCh1UkB/fF940olw Qb6Vbi2pUo7uFUPcel1EeYzp3Bimh4rt8QL+70IrFWaEbfj3yZzTHBgD/6hUlF2/ZDjr 25qrhAG3u4czUP0lLqAJieiNOPNkAatMojRPejLn6KaFUTX2cQMn1tP2wGL7RyVR2QSR jYSCADEFHkDG0LdMDQrnM0KN+ca5shR7shHC5L7DKnCqe38YiRj+0IP7s0ljuquYYoI7 i3cgMsP7Euv2dUuub1aieZaSBaAsWkqYUwVORsT6za4V5ED7HvOANe8AbMUPuLxgq+bY T+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=htKtzZCdQwDKTxVOYT/SnGuRM9NYo6PkBDLsoZZ2+po=; b=u2I4dTe71lL2V36/GbZGcxWfqbAIrAtVy3bWmHKm/DCzB/CqoFXrjyMvSlS1glLZHC jlh+Jq1xHQdO63pKDuUut+1q3Lh9KBQJodlkQqPN+48YdhCoXqfBFcKUzG5rtBQfMNTZ nmu37oagqkfKt2cIA+nJvCFV/7EA0S7DrzR48mGOHrTX+aTzIYv9QE/XuZlyLB7Ndt4i FuyFJvl8kz/QWqq2g6TRiMY6WaPBBFn43KdxQBP9kPBvtUdtxWtqIYs3rz81GJzfl6HN G+L0ct8Ihzlwi+YldtR6oEzevSgKMGgByx+EKuXQVpytx8cUMcDOdL1aQoIjcKb5uTcP pKQw== 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 l13si2071955eja.13.2019.11.21.08.22.38; Thu, 21 Nov 2019 08:23:03 -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 S1727107AbfKUQUV (ORCPT + 99 others); Thu, 21 Nov 2019 11:20:21 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:43166 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726967AbfKUQUV (ORCPT ); Thu, 21 Nov 2019 11:20:21 -0500 Received: (qmail 2054 invoked by uid 2102); 21 Nov 2019 11:20:20 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 21 Nov 2019 11:20:20 -0500 Date: Thu, 21 Nov 2019 11:20:20 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Pete Zaitcev cc: syzbot , , , , , , Kernel development list , USB list , , , Subject: Re: possible deadlock in mon_bin_vma_fault In-Reply-To: <20191121084842.095edf87@suzdal.zaitcev.lan> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Nov 2019, Pete Zaitcev wrote: > Anyway... If you are looking at it too, what do you think about not using > any locks in mon_bin_vma_fault() at all? Isn't it valid? I think I tried > to be "safe", but it only uses things that are constants unless we're > opening and closing; a process cannot make page faults unless it has > some thing mapped; and that is only possible if device is open and stays > open. Can you find a hole in this reasoning? I think you're right. But one thing concerns me: What happens if the same buffer is mapped by more than one process? Do you allow that? I haven't read the code in enough detail to see. Alan Stern