Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6186948ybi; Wed, 29 May 2019 04:17:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEglm0BBNwWUOHcKC5LLGV1/FA2dnWV/jdckPn1c/gnWumezGHv4Zpw7Dt4nicVl9Vovcu X-Received: by 2002:a62:7fcd:: with SMTP id a196mr100482798pfd.195.1559128628009; Wed, 29 May 2019 04:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559128628; cv=none; d=google.com; s=arc-20160816; b=E1qQruGFQ8+YiBxQWleZdpsoAUxyfnlJwjvtKw3HCkBWtQLreen0Jp7+FPWAjGdimM sERJi9pH5nLP8zRw032lckjqLGXFTZtnLeBjg8rG5ByqpQ4R+yins7UZ21D1zpjVkYdc CfbgjTphj1W60H+o2ffpA0y8XuUY/yBb5uCUSjgCOBoHTcJRLw2//0+98jCYFtX3A2iI GDh+LeblGWwlhLipB+bQfk+SiTzlMX5deGDLeSGiN7OxrArQFVr4CpITCk3x53sdUxvg 8NvnWlEldl1Bv89cTU5eJMKjILjGitHgVgTlKzLxGoXROWBzyVWlX+qbGNFk+Icq1C4Z 6n7A== 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; bh=nglDSRjyqh4M68OwxSkew8mHufGzcorra+gekKayoq0=; b=LNi3MY1R7DTzX03HZRa40xTri3iuXJfuyDpqCgMMMi8Zs/YCdsd8i8fiQE7l2g/tql +Sx4KMDZLe2hYusQwXfJMIOIBNOJn+IER4n0SCdrzhO703zo9MKz5kBSYhCptazP+BAB QbgqEKx/+MhX0DZSbRH/0/gwpXFXG0yxdK0V/FUV9SopmlkkaOWF54jVgXJSPTlw6wZy R6SnFUe0wSdgnuOA7mMgcrj28lZf8V2z4dthCXmZjhm/Lp1uZHOLkaS4tH1r8+TSDY5M FPXgRdGhQ3Oy6JBSoVvhthoCnzx/mCxUg58flLDNaktXtuul2hT+pdcuytcR7HtnDmSw T8Qg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t136si28642156pfc.144.2019.05.29.04.16.51; Wed, 29 May 2019 04:17:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726256AbfE2LPm (ORCPT + 99 others); Wed, 29 May 2019 07:15:42 -0400 Received: from mga06.intel.com ([134.134.136.31]:38906 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfE2LPm (ORCPT ); Wed, 29 May 2019 07:15:42 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2019 04:15:41 -0700 X-ExtLoop1: 1 Received: from paasikivi.fi.intel.com ([10.237.72.42]) by FMSMGA003.fm.intel.com with ESMTP; 29 May 2019 04:15:39 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id B02C22091F; Wed, 29 May 2019 14:15:38 +0300 (EEST) Date: Wed, 29 May 2019 14:15:38 +0300 From: Sakari Ailus To: Janusz Krzysztofik Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 0/3] media: v4l2-subdev: Verify arguments in v4l2_subdev_call() Message-ID: <20190529111538.uny5x4fulzi4rd2w@paasikivi.fi.intel.com> References: <20190520212747.368-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190520212747.368-1-jmkrzyszt@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Janusz, On Mon, May 20, 2019 at 11:27:44PM +0200, Janusz Krzysztofik wrote: > Correctness of format type (try or active) and pad ID parameters passed > to subdevice operation callbacks is now verified only for IOCTL calls. > However, those callbacks are also used by drivers, e.g., V4L2 host > interfaces. > > Since both subdev_do_ioctl() and drivers are using v4l2_subdev_call() > macro while calling subdevice operations, move those parameter checks > from subdev_do_ioctl() to v4l2_subdev_call(). Also, add check for > non-NULL pointers, including pad config if V4L2_SUBDEV_FORMAT_TRY is > requested. > > Having that done, we can avoid taking care of those checks inside > drivers. > > Janusz Krzysztofik (3): > media: v4l2-subdev: Verify arguments in v4l2_subdev_call() > media: v4l2-subdev: Verify v4l2_subdev_call() pointer arguments > media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument For the set: Reviewed-by: Sakari Ailus On the 1st patch __u32 should be u32. I'd suggest to fix that in a separate patch. This was a really nice set. Thank you! -- Kind regards, Sakari Ailus sakari.ailus@linux.intel.com