Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3905823ybp; Sun, 6 Oct 2019 23:16:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwAIshimm9PvVb0xEW4ghBno2d7gBeHfQSIjvXxZysWpXpFFTluZV5jhIiUq7MAuBRqQ2J X-Received: by 2002:a17:906:2794:: with SMTP id j20mr22269794ejc.291.1570428985411; Sun, 06 Oct 2019 23:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570428985; cv=none; d=google.com; s=arc-20160816; b=cN72Ew/S6vXfptk8E78IcoJrq/0X1S//16vN7AjhdXYRjhZH+1t5PXaY+eqs7NPG/z LTMypkgSlj3Ma6FcqQgopgHOnUOwl9lZy8AjXDwgp50ma1/C5FmC40/I3WQjlfLeOSkP QsUaqmnVy0txHM0XQ26TDD/c3z2qLcxnSlE2F5rr7NiHCtrVFKedgg49FGXUTqcAy6e3 Sx3PKbHLfVAdYI9xgJVl9lpoGDWzKiSpmxXGePqwVX4qvPpUOr+JIk8HLIIDGJZpbHmk mYA9EcQcVyTI5RKb7YpyH2HWvIIDxw7a0u559H95bvf0Hqg+XDzZUGH0BDx3lCSE1von Uhzw== 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=pfP6drXPoprKVpMZwbtJ9L/Nw9mUyKupJm/GF1sbNHc=; b=q4Bx1Q0oEYvj2UThoVpQpE+BbmV+krpRQAI5Hwj8MLDmbNhq6TIFSOtMNoEAre7EIq 0gavXj5sfUijpLncow5hWm207UFFi6zjKboz2s/fd6emrw8a4WXP0bxuk1uxZh9ZmiPH Lm/6fiVEosAo0XINbgax/LNGWEeyD5hhHAYMa6YdNyKQJdY29Lcclu92tq56z+XzEaWZ 5yi10dcqrqbI1rknGMLDYxSUkxKkcHywRvoh49ZLChBpyaitS8E+hxrWp32PygP82/K4 i8vux8386uDisM/+BQIHlCTpUWGPdgBtFi5wL7w5VA6tBDv2818IApWLZvRoCS2PK6au ntnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=b6Z6RJnw; 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 pv13si6263668ejb.79.2019.10.06.23.16.01; Sun, 06 Oct 2019 23:16:25 -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=b6Z6RJnw; 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 S1727222AbfJGGNZ (ORCPT + 99 others); Mon, 7 Oct 2019 02:13:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51516 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbfJGGNZ (ORCPT ); Mon, 7 Oct 2019 02:13:25 -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=pfP6drXPoprKVpMZwbtJ9L/Nw9mUyKupJm/GF1sbNHc=; b=b6Z6RJnwPHq7I9g1QevfL56ut uLNea6ljrTVw7c49cfta16/0gOL8KpdOovhRpL3/2GP0rT29ZMiZ/LvJXsdaEn3HV6q3L4rNTDQI3 c+wgg2BG2w4YI7OGepeWYJrSXu0iQENetmCOZ2CNh6qBppccaZQzPm72Ple6H3A1dyTR62NF6Ama7 roHumnpoIHKVkuaCeiTRCSTPSRWtsUtH2EmBlALDWG2Fy1nDlFU7xIt085E15UemeOyU5seWJ9Ael sbgLTsY17kFOx7WvlFoLutLMSuWaoYzYiuXWMSerHROaRg4brFgURyQheim/CFoxHtogJghBd6YZ4 8orT/mAxw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHMGq-00080T-UU; Mon, 07 Oct 2019 06:13:24 +0000 Date: Sun, 6 Oct 2019 23:13:24 -0700 From: Christoph Hellwig To: Alan Mikhak Cc: linux-kernel@vger.kernel.org, martin.petersen@oracle.com, alexios.zavras@intel.com, ming.lei@redhat.com, gregkh@linuxfoundation.org, tglx@linutronix.de, jgg@ziepe.ca, christophe.leroy@c-s.fr, palmer@sifive.com, paul.walmsley@sifive.com Subject: Re: [PATCH] scatterlist: Validate page before calling PageSlab() Message-ID: <20191007061324.GB17978@infradead.org> References: <1569885755-10947-1-git-send-email-alan.mikhak@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1569885755-10947-1-git-send-email-alan.mikhak@sifive.com> 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 Mon, Sep 30, 2019 at 04:22:35PM -0700, Alan Mikhak wrote: > From: Alan Mikhak > > Modify sg_miter_stop() to validate the page pointer > before calling PageSlab(). This check prevents a crash > that will occur if PageSlab() gets called with a page > pointer that is not backed by page struct. > > A virtual address obtained from ioremap() for a physical > address in PCI address space can be assigned to a > scatterlist segment using the public scatterlist API > as in the following example: As Jason pointed out that is not a valid use of scatterlist. What are you trying to do here at a higher level?