From patchwork Mon Jul 12 06:06:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472947 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2673625jao; Mon, 12 Jul 2021 00:10:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxwesORJzii4Wh7ZIoWUrmeByWIxXxRTav6tldJJZs72PZEC1cnCuaZECVvLofXBG5I+vc X-Received: by 2002:a05:6638:389a:: with SMTP id b26mr19075372jav.34.1626073822331; Mon, 12 Jul 2021 00:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626073822; cv=none; d=google.com; s=arc-20160816; b=hhPAyOFn2ssgKhBT3yfztpXEhdc5enaibvu9iJfpy+yZb3niPVXKz2sYQMy1CwgklR IF/54aoYQqYJT+2im/+6XxFUVgfSIevF93KwqkM5xVyskCtDmg7IAiRWi3h/MtnrkHpP bCvcJt6JQwwwKWFCPI1ZV2AHGVagcPB9pIxRgvgrNUWJHtzHB/zfMAt+lJ96NFFUKelJ ltcFopWJ72CkLxqg33Pkr/seV4EjH1HDbreHGlmaN0JPx5nmtdb3uGc42CkSUyQBU/n5 aTFLAgXiyWtZT9kbvBNINMqc9ykORY6+I6K+5MoFh9Sd0xzc609J8J4PB9HUEurHi3o0 rTeA== 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=90HUv14TWZlhBBnDAQPPtezMtnUeNSGaQK7tIKBh6cY=; b=CzL8lFziNSJYotKlXxFt6F41TabapgRsdYuTfoostQFso/zls9yDt/hbd4C+nT2ieu 7I+q5Fu/OC7IYZXJlN86kPRMGK/s9K9McwsAYdKCJx27jMo3geRELlx4XeoALNCvXkV2 XGg3QD7aOnonxphxwUvNqWJMLcQysPCN6ypNoED9YKJSsZ8PK9NCMMMwolYlEe89D+7Y 3cbOglDuwjPOswmjqcbtsTS61T605wqAMvoz5mkFazv0QOi+WQn2pzHFHj1vCTN8mqu/ 8ffppcbCkolfLsXMXghcqv17bq9PZyxcCns1I5S4RsoYuF/4gdOad0dI7PvyK1uW+BLn SOpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ImTuFIHC; 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 g12si16580694jas.65.2021.07.12.00.10.22; Mon, 12 Jul 2021 00:10:22 -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=ImTuFIHC; 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 S242386AbhGLHL4 (ORCPT + 12 others); Mon, 12 Jul 2021 03:11:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244134AbhGLHK1 (ORCPT ); Mon, 12 Jul 2021 03:10:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B497610CD; Mon, 12 Jul 2021 07:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626073583; bh=meGSFOMCtdiAnXguur9WjgDTfZSBr3cYmsBkn61VCDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ImTuFIHCqfYL6REZZNqX1rj5GqevUrayxgqIzLaqDyiznxcYI/w75C8hB4LAO+o7G /ajGey74R8oDWfkirSZDsvao+lWGD6zr3uVLcrdsP0HgtA6kpuGQ8eOWBLbeqz/P83 p8sgxqjJxfbTR2BPa8SHGqCfpjscuEHg7UXS4U+I= 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.12 290/700] media: subdev: remove VIDIOC_DQEVENT_TIME32 handling Date: Mon, 12 Jul 2021 08:06:13 +0200 Message-Id: <20210712061007.077175053@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@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 956dafab43d4..bf3aa9252458 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);