Received: by 10.213.65.68 with SMTP id h4csp705723imn; Wed, 28 Mar 2018 11:15:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+WF9d+Sd6XUc4dDJAsSYAIP/hyNPsYh0uPyPr29L+0JpuWLQMUmRwa4cdb8HoH/3gTMatT X-Received: by 10.98.200.130 with SMTP id i2mr3734933pfk.221.1522260948932; Wed, 28 Mar 2018 11:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522260948; cv=none; d=google.com; s=arc-20160816; b=Hkar6X3IbRnQcI+6K+ALmikByVnlWWRCBVGdOs9qzyZRi5XqSJYEO8jo3RqQijawYj 9iA/5ZXNs63nxG/Si8sbw+3IEAGFXUOJGe8MOrdcHxqp+SoYEwrLDwNr7P5wrVJ87uom bTpumG+/9u5ac2FbHDlmE1GJyU2M7G7V1DChZf8xs9euEpLMgWugDU9uJdfIFDi9iWg/ CCYhDOH0lOfxsox3D1V3xo/554duDgHrhE7UtTwhEVWdlg6B6dtLTWzLxInLRrUrh3Ls M9K1zOzxDMua9/Clf+kUnOlQJfvCiplF0PYErGdOThTrq8KsJlTMSw96IBlMAvJoKRCj QSbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sRxtJXseHIY5eqpSraAy16BMfc2vPhOz4apFaMKxnFQ=; b=zfzCEwYSHZlMIufPO9x9moLVNaKjjYd5ysGFs50/3PfS8KJ5zMZmInbCadoO7H53ty FdesTbQboJGQm5T69iAVlv3TfV3ObOBBdakkI/wZHBll1ODxaGk7W2JEjfh1v56KOFKP 3TSs0+1q+VCmXCPCnpjwCenLCHUjMUq/ZhUxWcB93dFsorboY+YfChMlR262BGrZrxcN 7XyBkcHl/OJJklvJVqI/AeaAEBLKtcrqSUca2+ZXxNkvNz521YD1dobZqYX68R4werGL 7jPQJlNjXrVtXnUmUdGxun9XBhwsAze6KNKqqQDeGcrrD5wZMxAL7vFtstS+acpmm/Gk VnZw== 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 b59-v6si3996872plb.530.2018.03.28.11.15.34; Wed, 28 Mar 2018 11:15:48 -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 S1753650AbeC1SNV (ORCPT + 99 others); Wed, 28 Mar 2018 14:13:21 -0400 Received: from osg.samsung.com ([64.30.133.232]:43209 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753130AbeC1SNS (ORCPT ); Wed, 28 Mar 2018 14:13:18 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 9DFD73B597; Wed, 28 Mar 2018 11:13:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qj8TQNA-sK88; Wed, 28 Mar 2018 11:13:17 -0700 (PDT) Received: from smtp.s-opensource.com (177.205.88.90.dynamic.adsl.gvt.net.br [177.205.88.90]) by osg.samsung.com (Postfix) with ESMTPSA id 041073B4E7; Wed, 28 Mar 2018 11:12:41 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1f1FYs-0005KA-I8; Wed, 28 Mar 2018 15:12:38 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List , stable@vger.kernel.org Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Linux Kernel Mailing List Subject: [PATCH for v3.18 18/18] media: v4l2-compat-ioctl32: initialize a reserved field Date: Wed, 28 Mar 2018 15:12:37 -0300 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The get_v4l2_create32() function is missing a logic with would be cleaning a reserved field, causing v4l2-compliance to complain: Buffer ioctls (Input 0): fail: v4l2-test-buffers.cpp(506): check_0(crbufs.reserved, sizeof(crbufs.reserved)) test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index c76438dd3ead..ca0a43ad4ec8 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -247,7 +247,8 @@ static int get_v4l2_create32(struct v4l2_create_buffers __user *kp, { if (!access_ok(VERIFY_READ, up, sizeof(*up)) || copy_in_user(kp, up, - offsetof(struct v4l2_create_buffers32, format))) + offsetof(struct v4l2_create_buffers32, format)) || + copy_in_user(kp->reserved, up->reserved, sizeof(kp->reserved))) return -EFAULT; return __get_v4l2_format32(&kp->format, &up->format, aux_buf, aux_space); -- 2.14.3