Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2023741ybb; Sat, 21 Mar 2020 10:59:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuMDAx1K5BNRCXEiDcvXS+KZEJHusfEi6aUXDo/Vd32bdjpxzVZHkGOotl0BYjNbtvy3uN8 X-Received: by 2002:a9d:4d0d:: with SMTP id n13mr11855671otf.19.1584813595222; Sat, 21 Mar 2020 10:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584813595; cv=none; d=google.com; s=arc-20160816; b=T8GYbBflXjTgDLWBwl1UFPRi3LBUIqkg/tUC2H2HKOsjshGPoPy2JgjuA4zj7CItnv 7G7grppkjhiZhOWzpk9QQ9I99NN6lQRprlQQW2hfw5biaRRxHMTXlB6a1WuK1h5c1tRt 3+iAxp28N2FjhfM0kxs1RzDZ0aUiKMyJP8OdD3v+3pOdl9fhmVzrx0F8QXDd9OTO+xim 5uv941BCYKy/T3dYiQu8T2YGHF2QrZN7Xz7hkemTrf73oF3GDGF+/uB0WrFcbo4+u82/ sqjkctqFCMfEbJQ244b9pABTl5LVr0YDybMA6nOt4jVqPDYwcZhdVOdD5V7pPkUOJUVz 26SQ== 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=Pv8727CqHKjdOJFWE3IBXc7KMjqe5Xxt4DnAwegUtcY=; b=aWmRPz02z8kuPSOp6/Uvjy7DLK8eKCMw27edp489XQkAQNOB3CPhdLI+hU/FNm4BSr 51c7hHhnzkQ4xdCY8Bqfp2O3kJaH3hY5iWlNWj6PqSNB7cNdz8jvuvAoVUwSAZ0A8Jkx wdbA5wYUiqE9JPIyqr9sJglFsC7+7WNPzsY8+TR9ponkEXo7z/THFtiw2WvnsGjm7v8Q uwjMEMWPKB7og5RZG5nVQ/2ZbFkqMjAWmAD5Zr4c+KhgC7fRga7Ekd0aidroMy6kZ/dn gQmZSDXg2Cc6ch7WEzhVNrn4Q4HAryaUWPglMCO9A0qwG+dmBtqMvJYMIhEc/QUsz8so tzxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aRu6Eu/6"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w203si4541340oie.193.2020.03.21.10.59.28; Sat, 21 Mar 2020 10:59:55 -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=pass header.i=@linaro.org header.s=google header.b="aRu6Eu/6"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbgCUR5f (ORCPT + 99 others); Sat, 21 Mar 2020 13:57:35 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39651 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbgCUR5f (ORCPT ); Sat, 21 Mar 2020 13:57:35 -0400 Received: by mail-pf1-f195.google.com with SMTP id d25so5085279pfn.6 for ; Sat, 21 Mar 2020 10:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Pv8727CqHKjdOJFWE3IBXc7KMjqe5Xxt4DnAwegUtcY=; b=aRu6Eu/6rjgASSbGgbWnx4cbAGbM8zBbTfdLAp1HbvBIztE22la/AaGt0U/57+qPjO 3HWGiE2vLPobRK1QsIIYzQnKaKzjlkUh+QBKSpQTfkEQSyG3azHj+mufy5xmMX7A70s6 8oInrQm5VqKFng0TgcjTWztj00aVQN7rm8WXVUn7GcLoiTYc9IkljbpYsdd30hDt3DAO iiCB7amVODyhQ3yqyzIOzeMb2qipzHto/eAdq8CBtAHnDCgTPHQZdEEUNqow30O+OzsH BkHvBB4ICQYqxLFN3FA+iuEvnHFuCCV69RvIuETn13ePpzmslMa3lKLSZvkW8usVjeVi cNMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Pv8727CqHKjdOJFWE3IBXc7KMjqe5Xxt4DnAwegUtcY=; b=NYNBFO0L2P4gXfqXMqSQrxofL7rD3Uo3tTpUtkZGnYFX2zzGRNDzZA1UeEqTDdIlew CM4QTOQBgXx0a1UlxRqplt/dKA/YPKMmy48XlYi+AM9GEXGgrKxTrRshw7rfN0cFkmow P1Oqy03bnpIKth+1epYNJgEimIInsFbB9pCyQ9JtA0b6hhbB7ETtmuLHQidhtldkbyhI 1/yL4VS2larb+vw+zDhNdxd4J2mblnAR+jkabPvgz2d7NdhMZAkpS8xtHDqfXkRXq4gC OMgo12T3lbUGm2Byu+yLVWzJZ7RdqIt/Vu59GOtltSNlCAS5D+qO1YjGDjwDlwlpOjQP U2aQ== X-Gm-Message-State: ANhLgQ0zgCstqtMvh1unLH8lE2s6mTDf2mNYb81005Bm4jKRFIcNbL1L gJeSHSuX+IH98E/GcrzLQbKsgFZMrBY= X-Received: by 2002:a63:257:: with SMTP id 84mr14127515pgc.304.1584813453119; Sat, 21 Mar 2020 10:57:33 -0700 (PDT) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id c7sm4007767pgg.11.2020.03.21.10.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Mar 2020 10:57:32 -0700 (PDT) Date: Sat, 21 Mar 2020 10:57:29 -0700 From: Bjorn Andersson To: Arnaud POULIQUEN Cc: Nikita Shubin , "stable@vger.kernel.org" , Ohad Ben-Cohen , "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Mathieu Poirier Subject: Re: [PATCH v5] remoteproc: Fix NULL pointer dereference in rproc_virtio_notify Message-ID: <20200321175729.GA52762@builder> References: <20200306070325.15232-1-NShubin@topcon.com> <20200306072452.24743-1-NShubin@topcon.com> <6c7ef4f2-6f71-c2fb-b2e9-ad7cbeb7cfbc@st.com> <20200310120846.GA19430@topcon.com> <507197c5412e4b438aeb5c527be74b3a@SFHDAG3NODE1.st.com> <20200311200107.GZ1214176@minitux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 17 Mar 07:24 PDT 2020, Arnaud POULIQUEN wrote: > On 3/11/20 9:01 PM, Bjorn Andersson wrote: > > On Tue 10 Mar 06:19 PDT 2020, Arnaud POULIQUEN wrote: > >>> On Mon, Mar 09, 2020 at 03:22:24PM +0100, Arnaud POULIQUEN wrote: > >>>> On 3/6/20 8:24 AM, Nikita Shubin wrote: [..] > >>>>> diff --git a/drivers/remoteproc/remoteproc_virtio.c > >>>>> b/drivers/remoteproc/remoteproc_virtio.c > >>>>> index 8c07cb2ca8ba..31a62a0b470e 100644 > >>>>> --- a/drivers/remoteproc/remoteproc_virtio.c > >>>>> +++ b/drivers/remoteproc/remoteproc_virtio.c > >>>>> @@ -334,6 +334,13 @@ int rproc_add_virtio_dev(struct rproc_vdev > >>> *rvdev, int id) > >>>>> struct rproc_mem_entry *mem; > >>>>> int ret; > >>>>> > >>>>> + if (rproc->ops->kick == NULL) { > >>>>> + ret = -EINVAL; > >>>>> + dev_err(dev, ".kick method not defined for %s", > >>>>> + rproc->name); > >>>>> + goto out; > >>>>> + } > >>>>> + > >>>> Should the kick ops be mandatory for all the platforms? How about making > >>> it optional instead? > >>> > >>> Hi, Arnaud. > >>> > >>> It is not mandatory, currently it must be provided if specified vdev entry is in > >>> resourse table. Otherwise it looks like there is no point in creating vdev. > >> > >> Yes, my question was about having it optional for vdev also. A platform could implement the vdev > >> without kick mechanism but by polling depending due to hardware capability... > >> This could be an alternative avoiding to implement a dummy function in platform driver. > >> > > > > Is this a real thing or a theoretical suggestion? > Only a theoretical suggestion, trigged by the IMX platform patchset which implement a "temporary" dummy kick. > and based on OpenAMP lib implementation which does not request a doorbell. > Anyway no issue to keep it mandatory here. > Thanks for confirming. I've applied the patch, with Mathieu's ack, and we can loosen up this requirement when we need it in the future. Regards, Bjorn