From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C42DCA9EAF for ; Mon, 28 Oct 2019 01:38:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E259E2070B for ; Mon, 28 Oct 2019 01:38:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Dfpu4EIV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJFVIuDr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E259E2070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+tNjCeBxBWWv6OBERqKhFkGhk0Ate6b9goAn0fvSCZA=; b=Dfpu4EIVdxaC+W njmZDklCwjlF3ZC9VEVVlIP4vkihfP/KlSwIC4sEmOWDOg8NCo4howsRYOsb+6WZIOphy3Vn6ZAJg LQ3YF0Uo8sm1asslK+wWgxIa+VhhIIPEjFuYXFHeR5Q5RmE1NvgVUn2mP4O3C36DPZAYmZXG7dvwO ZiU0ro21hmDEarG7eGo95Rk2PHoWBMYZQVDtJ/CeNs03bfFnxpUnZvG8v1RpAhW7Kfm02l5QtYGpa vGBwFdGdzG8E7Oj2f00Qw8pTgvnfqWjI/9Hghok9EwmMRsEPnvegj3fOP9bqdwqKxnuJ3YGDsIBXP MsW8BxqDWgKQkwegNmkw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iOtz6-0002Tz-HM; Mon, 28 Oct 2019 01:38:16 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iOtz3-0002TV-Hz for linux-arm-kernel@lists.infradead.org; Mon, 28 Oct 2019 01:38:14 +0000 Received: by mail-ed1-x543.google.com with SMTP id a21so6615359edj.8 for ; Sun, 27 Oct 2019 18:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zncCQd975Gz2HvK2SjXCCS9OAbsNjkyZCeZT6yaW7zQ=; b=MJFVIuDrAyz9pDLgpUUl9PU1eZbzKuPQNiEAzcQW1qYjBZjuoWDjrqGy9uWwBC66Cd dI3yEdlYrJi9nlHlHzafl7i8WvKj/XLHxPbDWEtsBpUBMumEUFvInIYQnVTLK+ti+7tO BA7mgqjIeTWS1O1WIN27xKabnFwlPMrDCiIPvQUPLPAq7HMw8gsza012bODYpDuy2/vD taxlG8IqDmUdHTSnMyFv5PMGM92EtSdVF5rDTJo3CJh1YqlOtU4Zj+9HaR42o5jK8e3s jenl27VKb6t9BWfqRxFCO0FEO8G9hJFf5yNF0aRrMh28ErjfYLPp42bc4NbualuBRcp/ eA5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zncCQd975Gz2HvK2SjXCCS9OAbsNjkyZCeZT6yaW7zQ=; b=KRJCadBJEpt/69RXBVSAhg/GI2lHy+VBjLuloQkQ4Lre3rHjOujYikRdF1x3tVPUV+ ItnkBVq4ZIRNBBfKqegYh1nAFTimcUb/Fy9SfGpeTIR8QJgamclE+8pPLb+Sn/Xgh4Lx YZvXyrGKWInnZUnc1AKF0Xw0qg3RbIHRRKMZ/Vi1xtNNvEeqOC6mAJP/Jd64qWmwzhCd iaJOyPFNIYS5Pe3ItbJfOx7/fzggraOP5OcNn5HdLKi1wFvfE+BHgyb92/JBrankoABD rLvX9dblwohyBSmxeI8Qnzp8ehVM4hQS27bsjIXGrYqpveQn443SW9SN3VU7Mj5f4QKn p2VA== X-Gm-Message-State: APjAAAX/pYpeYn9wyHb646Gei5pj94s3sfNW9NTs7KvfeyyvAdFLxtLD hnsuZkjhy6w6spauZEeqD2kyAHjgKNKX86x7XHI= X-Google-Smtp-Source: APXvYqzgnaDiUcH3IYDfQVBOpeExgcPu32wDgAZkOKAPutypEopBXKs6avGlVlBxf+yhnsEi3FfGHSOF7QMkbQk2/Ug= X-Received: by 2002:a17:906:1d4d:: with SMTP id o13mr10006173ejh.196.1572226690648; Sun, 27 Oct 2019 18:38:10 -0700 (PDT) MIME-Version: 1.0 References: <20191017025058.31528-1-hslester96@gmail.com> In-Reply-To: From: Chuhong Yuan Date: Mon, 28 Oct 2019 09:38:00 +0800 Message-ID: Subject: Re: [PATCH] spi: pxa2xx: Add missed security checks To: Andy Shevchenko X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191027_183813_619766_04BABC69 X-CRM114-Status: GOOD ( 19.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux Kernel Mailing List , Haojian Zhuang , linux-spi , Mark Brown , Daniel Mack , Robert Jarzmik , linux-arm Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 18, 2019 at 10:04 PM Andy Shevchenko wrote: > > On Fri, Oct 18, 2019 at 2:37 PM Chuhong Yuan wrote: > > On Fri, Oct 18, 2019 at 7:14 PM Andy Shevchenko > > wrote: > > > On Fri, Oct 18, 2019 at 1:39 PM Chuhong Yuan wrote: > > > > On Fri, Oct 18, 2019 at 5:35 PM Andy Shevchenko > > > > wrote: > > > > > On Fri, Oct 18, 2019 at 8:59 AM Chuhong Yuan wrote: > > > > > > I'm not sure they are mandatory for all platforms. > > > > > To be on the safe side, you simple need to add _optional() to the both > > > > > call along with above change. > > > > > > > > > > > > > As I know, this is the only one in spi which does not have a check for > > > > devm_clk_get. > > > > > > For some it still may be optional. That's why better to check it and > > > mention in the commit message. > > > > > > > Even if add _optional(), they still may return errors and need security checks. > > > > > > Of course, see "along with" in my previous comment. > > > > > > > Got it. I will send version 2 in which both _optional() and security > > checks will be added. > > Let me be clear. I didn't check if _optional() needed or not. You need > to investigate this before sending new verison. > And in either case this should be explained in commit message. > I have checked this file again and found ssp->clk is used by clk_get_rate in pxa2xx_spi_probe. Therefore, it should not be NULL and _optional cannot be used here. Besides, ssp->irq is also used in pxa2xx_spi_probe. Hence, I think this patch is fine. Regards, Chuhong > -- > With Best Regards, > Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel