Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3905300ybp; Sun, 6 Oct 2019 23:15:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHY9W7OpxBtaTJ7wXaKn6x67GGqK6nnmX3Zf4exCvFImPQdF9zFB0OZxHKJ6LCsgKrwr7W X-Received: by 2002:a17:906:7d10:: with SMTP id u16mr22494695ejo.194.1570428943961; Sun, 06 Oct 2019 23:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570428943; cv=none; d=google.com; s=arc-20160816; b=PJSKnM+IpSYyxNdx+lbx8azmlN3U3ZM7m1nxaDdxZgpqh3MFyUhp0O5YF5uzMDjFnQ jewGGnwO7BNyg8XsmoSEdv26YXAQb07oZwAckmGUo8dSPYh/gxy9bVxJtg4ZM8vtl/Jp h1kK9oRltkk3prDhXSVq5L8wTmiZkpq8s3gdfAtyoAU2CeQlZ8GeUlkZlhtMnEZtqlZ8 OEYhUEupG0N6CYi3Ge2LZZUKbpWmz3t2YVAoZVj/xphuIHPedJZ30ZVGkw2eIr/F5T7Z A61Dwgy4JJSsH94MrlVLe2RCNNPLucDdsskfB8i1pHdbSfaUNPNpVBxLBi4tw2DHXxw1 ekzg== 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:dkim-signature; bh=+RE624T/XEpD1avT5GfVdjNCs+ZJWmT9YjXQaqBZM7k=; b=QWPUTA0aYr7CrEdx+pXE3NIzKzn+oKySidXz1PiaSpe4lVpV6JMK8DT82QjW6jntof Xk/iDGivbarCDMCdpERVd5CN2JMyXxV4VEmdpJG9J1k7m2qEH+bk6HXE1sa+oj7Regv1 nyDWHRsPP7KJ+KP+mGxPHpMLvZSIV3L52EOUGOLKcdw8PRdsdqE6boxdhO2cXDWfWzFg LcQ2NTc7daAQT0qB+/QMR9iPjpoIlzE8sQg4pmlV5neHTlMSDWJKPaflSbgS+3ZbYj1c Ty/A2MEl2hrDZ2nYiDVogxUKoItOAUtKGiuosMRMksUuhHKdMZ9DGvjxHa+HzGsDz4DP h4aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dPkKWkMl; 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 t7si6813921ejo.302.2019.10.06.23.15.19; Sun, 06 Oct 2019 23:15:43 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dPkKWkMl; 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 S1727103AbfJGGMO (ORCPT + 99 others); Mon, 7 Oct 2019 02:12:14 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51492 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbfJGGMO (ORCPT ); Mon, 7 Oct 2019 02:12:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+RE624T/XEpD1avT5GfVdjNCs+ZJWmT9YjXQaqBZM7k=; b=dPkKWkMlKUhZZB5fhKh1ODpeT 16ZHXI5t8z+ddBZDENkb6wpNM1HVKrAosj7Kx1FCMvsG3y4CstGls4eJr+psTuhVbafWlARVZbDBy r18be1Pg7voEFXL8M37tV6X7RbxQ4hDCMRCYEIoJf8KRxQnyDRrfpUogj0h5XqrEiOF8i5EBLS/wd bQ71lm27gW6ic7Wq2zHwGP0MKH/7bdHidtC0AdBlXxA6RrI8Her5gSS3ZaL0YK/4bBSnRVedH+fYG CKA/0PWJiWAic++x07UfEEzYOapftae0PFbULcKoL0vh9s4E27jgwWtAszbsvT9SoSFPISpQHZVWl VYWnZrUHQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHMFg-0007yp-9K; Mon, 07 Oct 2019 06:12:12 +0000 Date: Sun, 6 Oct 2019 23:12:12 -0700 From: Christoph Hellwig To: Jason Gunthorpe Cc: Alan Mikhak , linux-kernel@vger.kernel.org, martin.petersen@oracle.com, alexios.zavras@intel.com, ming.lei@redhat.com, gregkh@linuxfoundation.org, tglx@linutronix.de, christophe.leroy@c-s.fr, palmer@sifive.com, paul.walmsley@sifive.com Subject: Re: [PATCH] scatterlist: Validate page before calling PageSlab() Message-ID: <20191007061212.GA17978@infradead.org> References: <1569885755-10947-1-git-send-email-alan.mikhak@sifive.com> <20191001121623.GA22532@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001121623.GA22532@ziepe.ca> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 09:16:23AM -0300, Jason Gunthorpe wrote: > > If the virtual address obtained from ioremap() is not > > backed by a page struct, virt_to_page() returns an > > invalid page pointer. However, sg_copy_buffer() can > > correctly recover the original virtual address. Such > > addresses can successfully be assigned to scatterlist > > segments to transfer data across the PCI bus with > > sg_copy_buffer() if it were not for the crash in > > PageSlab() when called by sg_miter_stop(). > > I thought we already agreed in general that putting things that don't > have struct page into the scatter list was not allowed? Yes, that absolutely is the case.