Received: by 10.192.165.148 with SMTP id m20csp361704imm; Fri, 20 Apr 2018 07:59:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx49p3V5h3zwIpwKT8Plrwl4ZYhKQDY/TtLMCNQArPZDYsTwOU5Eb0pW66zoMmaRzpJYA2PJt X-Received: by 10.99.125.19 with SMTP id y19mr8867898pgc.160.1524236350363; Fri, 20 Apr 2018 07:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524236350; cv=none; d=google.com; s=arc-20160816; b=lc9zUmtIw9vSpc6eIECvzwDIyXEKWckNVB7rti3nFgnBf7aE41HwoyJbi8F68vCRUj pSxVAmgm6n/LhmRBhngVVA5/6/+MPN3y9dV96IAf7o+rj5dyyfx/THWAs48sSLjwi4bd wd/Qbnz2pOFHDNr2JHq+6LJUDuYz6RwufnJpETQbPc1ttZ66dbw+xN2sfOwDqcQGN4Cn 2n6RmAzjohyaG3UTMKwWYF3pH14tPFjzsEFt9BBk8WTsRa0IfVG73OngNpMPZKrweZwm hOnRGB4vmB1p2zDFmiP2jEDyvEKM61QhRalByWoknAj9rd4UWcaxeLnIPajWceMnQu6+ ijnw== 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:arc-authentication-results; bh=YsrwzzU5DVGlUJWlxWmdmpWOU/5QWrCdku4EwS0+mb4=; b=UHNp8IyUU+FX/wlMfQHa2kHgWyzfzvjSaWp9T9OTtJVJJv8mrhe9BtxQPyTR1Zb+s1 lgwFJtJo1iWkAuhkUBZz1Je7IOD5KUMIZLIkI3Q+0Fw7XRCbU3XG5zEAVkqLlp7XWapa XbMlzTJT/cAV49mvTyq2eOPqper8GrCOk/KgdZl4t1u3nEIm4y/KLSrmHEWecaiD+fPs 3QYJ80aXSob79HNPiYpfIeRThwn6XKrEA9NW9ZqU6sdUZXKWFZ3+u5jucjfbYmVcTzEt 8X9iXuRCQnP1pWB9p7R87Zx0YxMG9Ao2DfJnWrQUburBrj9xbcWJGm9AL1PvyAz0Gr7n JwCQ== 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 g14si4872375pgv.625.2018.04.20.07.58.56; Fri, 20 Apr 2018 07:59:10 -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; 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 S1755538AbeDTO5J (ORCPT + 99 others); Fri, 20 Apr 2018 10:57:09 -0400 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:46126 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755243AbeDTO5C (ORCPT ); Fri, 20 Apr 2018 10:57:02 -0400 Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1f9XSX-0000jT-00; Fri, 20 Apr 2018 14:56:21 +0000 Date: Fri, 20 Apr 2018 10:56:21 -0400 From: Rich Felker To: Geert Uytterhoeven Cc: Christoph Hellwig , jacopo mondi , Jacopo Mondi , Yoshinori Sato , Thomas Petazzoni , Robin Murphy , Linux-Renesas , Linux-sh list , Linux Kernel Mailing List Subject: Re: [PATCH] sh: mm: Fix unprotected access to struct device Message-ID: <20180420145621.GQ3094@brightrain.aerifal.cx> References: <1523972123-5700-1-git-send-email-jacopo+renesas@jmondi.org> <20180418104703.GA12462@infradead.org> <20180418131314.GC3999@w540> <20180420083147.GC31275@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 11:59:13AM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Fri, Apr 20, 2018 at 10:31 AM, Christoph Hellwig wrote: > > On Wed, Apr 18, 2018 at 03:13:14PM +0200, jacopo mondi wrote: > >> As long as it goes for arch/sh, the only user of dma_alloc_coherent() > >> is platform_resource_setup_memory(), and it has been fixed by this > >> patch. > > > > Great! > > > >> Unfortunately, as Thomas pointed out, there are drivers which calls > >> into this with the wrong 'struct device' as the sh_eth one he had fixed. > > > > Yes, we'll need fixes there. Other DMA ops implementations also look > > at struct device, so they generally are buggy. > > > >> I would then say that as long as it goes for the NULL case, we should be > >> fine now. > > > > Then I'd say skil that part, please. > > The major reason for keeping the NULL WARN_ON() checks is to make it > obvious to the developer what is wrong, and fall back to the old behavior. > > Without the checks, the kernel will just crash during early startup, > without a clue in the (missing) kernel output, usually leading to a > frustrating bisection experience (if the developer is sufficiently motivated, > at all). > > Hence my vote for keeping the checks. Sounds good to me. Rich