Received: by 10.223.185.116 with SMTP id b49csp6367172wrg; Wed, 28 Feb 2018 08:15:14 -0800 (PST) X-Google-Smtp-Source: AH8x2260OUei/Y5e1L5UsyO9CFl7chQI8HU+9AyqayIVm/d5cE6yUp+4yrhKEnPQ4HFsTD2A1Rie X-Received: by 10.98.159.85 with SMTP id g82mr18099101pfe.15.1519834514091; Wed, 28 Feb 2018 08:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519834514; cv=none; d=google.com; s=arc-20160816; b=Se+9KfcTOHS1RenrGxyPatUN1sAL+9XTpgpPDo3wUU7CVcC5QW0VsPaHLm31EAaSVt pGX07qbjk1ZMzYsqawNDzNVXPsFRax+/87RdntEUA7S9lOP64vN3Huq5EOyg5ABJ3gUv gcDiSf56Etzw4M3A+r93vC3MOeSpCBFhegGdUoarVRhgQOU8SyhLXR5TKoU3dTPWiNLE E2xs93xoEH8Dd335i6MdozNEE03omk+XN7Ol+EJRt8TagIzR20tc0G0wXNe1bmCIjs5V deCE7PL7hmuCnmlnJgKkpA0BFprVqvEQV6bh3/LsRDmcud5Q2/rLH0Bjj+iCjMOyRTgg g+bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=VZZut6chTjyUg+mhYC1n+HwiFEwyrI8J9sfl8qwKY10=; b=XtkKt+xM2t+xjUXGYUzeQjM1/G0wRjZZjo7dSaLRQcdm1LgpJYCwq3jHTbu72FjFUn KSobnvOU9aoqcAJlqN/A5cHFRhaUxZoeea/ghrtvJBQDC559sw5yVKQELJg7phC5HS4n wdr72aXh46fwyJFJN+lRGTM9viJQiy7B7bCEaqc9215TykquvHbyjqObtuKFqm3DptvA Llh1ja9iUhCMA53PHlSm6hsY55k+GHYUHc/C1bvFTMxDOf7mwiKRR5H8gMsNXe6LzARk Ni8R/sI7cmQdg91MqqTYQoxzAE4quwTyc08i2xX4QiFBLn0QjDNOYOohOsOrbptmUHm7 4WDA== 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 x3-v6si1495863plo.608.2018.02.28.08.14.58; Wed, 28 Feb 2018 08:15:14 -0800 (PST) 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 S934636AbeB1QNx (ORCPT + 99 others); Wed, 28 Feb 2018 11:13:53 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35071 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932383AbeB1QNv (ORCPT ); Wed, 28 Feb 2018 11:13:51 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Ym-0006Xl-DI; Wed, 28 Feb 2018 15:22:25 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yk-0000J0-PM; Wed, 28 Feb 2018 15:22:22 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Tiffany Lin" , "Mauro Carvalho Chehab" , "Hans Verkuil" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 237/254] [media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32 In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Tiffany Lin commit baf43c6eace43868e490f18560287fa3481b2159 upstream. In v4l2-compliance utility, test VIDIOC_CREATE_BUFS will check whether reserved filed of v4l2_create_buffers filled with zero Reserved field is filled with zero in v4l_create_bufs. This patch copy reserved field of v4l2_create_buffer from kernel space to user space Signed-off-by: Tiffany Lin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Ben Hutchings --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -259,7 +259,8 @@ static int put_v4l2_format32(struct v4l2 static int put_v4l2_create32(struct v4l2_create_buffers *kp, struct v4l2_create_buffers32 __user *up) { if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_create_buffers32)) || - copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format))) + copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format)) || + copy_to_user(up->reserved, kp->reserved, sizeof(kp->reserved))) return -EFAULT; return __put_v4l2_format32(&kp->format, &up->format); }