From patchwork Mon Jul 12 06:06:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 472891 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2655765jao; Sun, 11 Jul 2021 23:42:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpT9jRAzCCJB7liDFh2d9WEadbpbkb6Ntib/mZ+054V1kgEG9trU/4hcTA18lfMVQYvVoX X-Received: by 2002:a17:906:3042:: with SMTP id d2mr51752941ejd.234.1626072155136; Sun, 11 Jul 2021 23:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626072155; cv=none; d=google.com; s=arc-20160816; b=kC1M14yXQV6W1iY/JOEkfo+KjLTFRCqKlzQaCtvWLHgRRBEPZCYSca3TFEudVHCdjc Sla/+VQ3FoQP81eq6xZaacK1VETwp/JiCB1eTnnW7j3sY1DMM+hEhHVIf8uz6wiQ/zfI Nk0j+Fge9yDsh2ktN4VaNJGsiklD8bFW2Ru7s/iaYPv9xqT1McEBc3JDqkpcdM4Un325 VoZ57OEN+GvF28C8jHyqixspcyCzqNAwEmqfcnWrCLdocQ4mI5iKcFhRJPRaF08lXCKY /t3m3M/oMGcq0MxYM1MLbSSH3dn7HFYkOcGYkEmcIdk7WU2MdRnGtWN4wSB9iWh1mtpB 4mkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ub/vYPaHTo89s8ocSiO86JNJU94WKwRZOrF8vTYliNQ=; b=iCmqTb9YZj8W3RhX45x8QMoLloKZ04cOF9vCxreyaj3OOz/r1tc5icSbCZwjb2VBS6 /ZBZR/o18RSoIiCcgHXr3UlsLMcJR3RDknKPTLdDZWQa4YMpNOlnWMUAVwGpC8eVRoVr 14FgDu7NT+M3SmqYsmXbhP1GIMOSJSSo4YbYhLs9SPn3XISFzNjIi4SjC2bOnjNxKPjM epbx2SjLLuinRKfNKpRoDLMhNAb5zUmfcM110sMOcdZU9csbIYUlnUpdRVHq+EyfEDFJ vTONtT2ntB7WFlpU8evqJFGywUzMJqMT3SL+VZ0pNpeVkyMZNc2Wg+idNHoFVPYJ/ZpY CAWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qhBKA59b; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id en10si16062540ejc.118.2021.07.11.23.42.34; Sun, 11 Jul 2021 23:42:35 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qhBKA59b; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238408AbhGLGn7 (ORCPT + 12 others); Mon, 12 Jul 2021 02:43:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238072AbhGLGmJ (ORCPT ); Mon, 12 Jul 2021 02:42:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3555610F7; Mon, 12 Jul 2021 06:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071939; bh=XYI3V6KnBMu+Z6wr9Y1e/kS+6vhpi7SEOLXD2SNfIhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhBKA59b2Ho5C+U4RN8Dnz8p93WZferMGg+xdDRNbRddEyaal7XbpoLPwAr7ASHXB MyNGqTuV2CY3GWOwmIzG+JpirdiNG5plu1BboCpqw0Cp9oxkL+erjc8agwA2Nfu9gF 7a/ZPNeu2W66mlM1or1+hPUf4vHA2FN8MIz0XxvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 248/593] media: subdev: remove VIDIOC_DQEVENT_TIME32 handling Date: Mon, 12 Jul 2021 08:06:48 +0200 Message-Id: <20210712060910.194280741@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 765ba251d2522e2a0daa2f0793fd0f0ce34816ec ] Converting the VIDIOC_DQEVENT_TIME32/VIDIOC_DQEVENT32/ VIDIOC_DQEVENT32_TIME32 arguments to the canonical form is done in common code, but for some reason I ended up adding another conversion helper to subdev_do_ioctl() as well. I must have concluded that this does not go through the common conversion, but it has done that since the ioctl handler was first added. I assume this one is harmless as there should be no way to arrive here from user space if CONFIG_COMPAT_32BIT_TIME is set, but since it is dead code, it should just get removed. On a 64-bit architecture, as well as a 32-bit architecture without CONFIG_COMPAT_32BIT_TIME, handling this command is a mistake, and the kernel should return an error. Fixes: 1a6c0b36dd19 ("media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABI") Signed-off-by: Arnd Bergmann Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/v4l2-core/v4l2-subdev.c | 24 ------------------------ 1 file changed, 24 deletions(-) -- 2.30.2 diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index a7d508e74d6b..fbf0dcb313c8 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -428,30 +428,6 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) return v4l2_event_dequeue(vfh, arg, file->f_flags & O_NONBLOCK); - case VIDIOC_DQEVENT_TIME32: { - struct v4l2_event_time32 *ev32 = arg; - struct v4l2_event ev = { }; - - if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS)) - return -ENOIOCTLCMD; - - rval = v4l2_event_dequeue(vfh, &ev, file->f_flags & O_NONBLOCK); - - *ev32 = (struct v4l2_event_time32) { - .type = ev.type, - .pending = ev.pending, - .sequence = ev.sequence, - .timestamp.tv_sec = ev.timestamp.tv_sec, - .timestamp.tv_nsec = ev.timestamp.tv_nsec, - .id = ev.id, - }; - - memcpy(&ev32->u, &ev.u, sizeof(ev.u)); - memcpy(&ev32->reserved, &ev.reserved, sizeof(ev.reserved)); - - return rval; - } - case VIDIOC_SUBSCRIBE_EVENT: return v4l2_subdev_call(sd, core, subscribe_event, vfh, arg);