From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B56943EFFD4 for ; Wed, 1 Jul 2026 08:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782895859; cv=none; b=tw90o5UjT9Cl4de1VF5VrNzXWDc7aAI6byCG0FAl8jmZVo7hyvnlbZBdrl3CweQ5N9/RLrEpyqD2fOI2HoKR9DHv4HxqXStWu3/trV+DAcqpE3TkBm+DIyP0+67279ipSdS73t2fGr8kpuikdbmljvTUY3ufpio4f3j3TbodPok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782895859; c=relaxed/simple; bh=H55EFXYEtJ2d9g9JrubASYHPlUgM/ks4LR2U62y++UU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UsQsmLu03JucGlJQL0rtpvKGrkJdOk3TbGxB7k+erPlLGg7lH3jZDDPw61doGB6EBvgZfq/EOOBMRoJPj8UHdd3uK9ek9MEvEkP7XEMMJD7He2NdjD1px15ls1sfEmCoI/3vD+hBzIni/fQCxII8cnUyJDFc3Xm6Y7YaHHLC/Zo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=Zr8uOxId; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Zr8uOxId" Received: from ideasonboard.com (mob-5-90-48-115.net.vodafone.it [5.90.48.115]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EBE19E91; Wed, 1 Jul 2026 10:50:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782895811; bh=H55EFXYEtJ2d9g9JrubASYHPlUgM/ks4LR2U62y++UU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zr8uOxIdhUDjCE9sOoDwIKpAWYCwEl2XEiSxDdxQJXb1wHlazEfhS4GPRK3tl2RvC 33MQ/5L0N5ZdZE4+VCHylJJoGyXyM5Ou0cu8+KifaZ7WZpjMsYZdnv28gcsPlOHgFl 3teD8/Eq73bWCNR22dDkGyfSwBUA/2AKvAPfxAFU= Date: Wed, 1 Jul 2026 10:50:51 +0200 From: Jacopo Mondi To: Linus Walleij Cc: Laurent Pinchart , Vincenzo Frascino , Jacopo Mondi , Nayden Kanchev , Konstantin Babin , Daniel Scally , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [PATCH] media: v4l2-ctrls: document expected validation scope Message-ID: References: <20260701-v4l2-doc-v1-1-9cce64b7a1c2@kernel.org> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260701-v4l2-doc-v1-1-9cce64b7a1c2@kernel.org> Hi Linus On Wed, Jul 01, 2026 at 10:11:20AM +0200, Linus Walleij wrote: > After discussion on the mailing list it became clear that these > validations are not expected to be exhaustive. > > Link: https://lore.kernel.org/linux-media/20260629133209.GG3054459@killaraus.ideasonboard.com/ The above linked discussion is about parameters buffers, which can indeed contain large sets of data. I'm not sure the same applies to extended controls ? > Signed-off-by: Linus Walleij > --- > Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst > index b8698b85bd80..58184b6e386f 100644 > --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst > +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst > @@ -118,6 +118,18 @@ correct. This prevents the situation where only some of the controls > were set/get. Only low-level errors (e. g. a failed i2c command) can > still cause this situation. > > +The validation of controls is not expected to be exhaustive, for example > +custom controls under ``V4L2_CTRL_CLASS_USER`` would become very voluminous. > +The expected behaviour is to reject settings that could: > + > +1. Pose stability issues, such as turning the hardware unresponsive requiring > + a hard reset, such controls must be rejected. > + > +2. Pose security issues, such as compromising unrelated kernel-contained > + data to userspace. > + > +Extended validation of control values should be performed in userspace. > + > .. tabularcolumns:: |p{6.8cm}|p{4.0cm}|p{6.5cm}| > > .. c:type:: v4l2_ext_control > > --- > base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482 > change-id: 20260701-v4l2-doc-c60195d38d00 > > Best regards, > -- > Linus Walleij >