Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3404350ybt; Tue, 30 Jun 2020 01:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzMhrnXQqpE/Lu27B1IfIMJ0mnhvSGme8O9Nlfs+482YIRGz1AMQzLOmXgLrSj4NihHECD X-Received: by 2002:a17:906:f20d:: with SMTP id gt13mr11947433ejb.117.1593506697846; Tue, 30 Jun 2020 01:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593506697; cv=none; d=google.com; s=arc-20160816; b=y5Gll9sP0VhyQnt94U3O/0zVfIsN5vT4FDvuWNsAUWa6wP6gJwwFCJ3bqtP1KOITjt QeKDHGrPQ+CFBg4CA110V/T+4ZvuBUwVpRupuYt79JfkSHVSZjcwPhgQOGeenofU5BWu jJ+EQG8T/jC1c/znJkpyIb/jDB8vekQZ/DbWQEex1GQDqVvM8cJEIi5rDynm8m0X4rtC tF3AeH13NghiC5B21rSpPR1z4puJJY13I9TKYv+A0JSUMG/sgcJQMAQlsw7GYs5iE1rb Ctz2CLvWiJelWXzSz6FqIEq+dUxfZm/khedUMWW8IJM5+CVSSesK8+/j9muCcH8LPpEJ EjEA== 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; bh=eg3i2iBXFtYpQEkfOLwP4LoekdNo82TPbHK7DRZ9i3U=; b=pLs7tldsVjog6XMkOanrdqY+V+PYCiYvmQ207EugnI4aO5/+Ayh1LwmEExTbMKyho1 Ebv6qEGKOHfsnwxjH8iyWV/ZRhzmXkaghDaFsyHeZgWz+EBwZ5Cwrreo1QesaDTfOvap cAhg2zEfjkuxmW8SQOZjd50deMQmxyPPcRWegtSFXlDDC42mRDuTQM7/yTvXhJcGJN3y obhPoqG25s+21zN+8fGAhnWWdwJKvGUrvBOvZCJWVrdNCNNHrEUXRWTv+PHm3E7MMpwL xGkzvitPixPNAtI42RGWS4NRoaTO2KXvCiKZIqww8yXstdnyPFkKKhOSCLyMWN3U2KJs eIiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yh22si1460809ejb.62.2020.06.30.01.44.35; Tue, 30 Jun 2020 01:44:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731615AbgF3Im4 (ORCPT + 99 others); Tue, 30 Jun 2020 04:42:56 -0400 Received: from 8bytes.org ([81.169.241.247]:50572 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728132AbgF3Imz (ORCPT ); Tue, 30 Jun 2020 04:42:55 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id E504F26B; Tue, 30 Jun 2020 10:42:52 +0200 (CEST) Date: Tue, 30 Jun 2020 10:42:51 +0200 From: Joerg Roedel To: Robin Murphy Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Prakash Gupta Subject: Re: [PATCH] iommu/iova: Don't BUG on invalid PFNs Message-ID: <20200630084251.GA28824@8bytes.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 02, 2020 at 02:08:18PM +0100, Robin Murphy wrote: > Unlike the other instances which represent a complete loss of > consistency within the rcache mechanism itself, or a fundamental > and obvious misconfiguration by an IOMMU driver, the BUG_ON() in > iova_magazine_free_pfns() can be provoked at more or less any time > in a "spooky action-at-a-distance" manner by any old device driver > passing nonsense to dma_unmap_*() which then propagates through to > queue_iova(). > > Not only is this well outside the IOVA layer's control, it's also > nowhere near fatal enough to justify panicking anyway - all that > really achieves is to make debugging the offending driver more > difficult. Let's simply WARN and otherwise ignore bogus PFNs. > > Reported-by: Prakash Gupta > Signed-off-by: Robin Murphy > --- > drivers/iommu/iova.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Applied without stable tag, thanks.