From patchwork Tue Nov 19 05:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 179693 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp167882ilf; Mon, 18 Nov 2019 21:48:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwK6iIF1MI884C1yHfAvCuySsUiapELASmNuJDHp5dMO449KUeg0DuqejKQXG8yNS3Y9uhI X-Received: by 2002:a17:906:f91:: with SMTP id q17mr2381440ejj.302.1574142523632; Mon, 18 Nov 2019 21:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574142523; cv=none; d=google.com; s=arc-20160816; b=T1xJAO1yXSBcbvsi5zKR1cTo8Z7pBSri/RiXGyH1sLGsiXJmzCguuaMjmBzp88h3D5 cOBJlB3+i7xgLmHkONSzTe6E/+2f71JvzsY4Cp1m9ccrZd2OhthYP1fEoqY5KkYjJnQh t8R7RrpbmFUzyhT/eWXXgmCvXEmV3B39REzOFo71PZKZD9r0wiTpUYNV4+t0UItFVVSq pbjyOUZkyR2hZh8i5cCGvTqRcLh6KR6B7KHrAoV8kh3B1CfEPNoFr7T1ii/7lPKo0zHu 8jzw1hPgw2B0tS8cE5ujJSW47HyXqIltUwzCo166wF4XVBcB/VsRXvpSg1wNZzlGvNBr tWYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kwt1dgASAWNWu32sF1iayuXoQmFkoDddC1Zpkby0fog=; b=G9wrWRywICIFb9ls9PUPZzi6bDmcpioFPAULL4N8879ImXa0kmgqTKZIoKU3FvUGoZ HZgAWIxBro41pijRj2oMgOxD7Ts/rWRWb6GpadKighNSnIhdid/OidvEKqFbqQES/wxp hKZrFKkB5DBNg44+USpmCJtW7WCJTX+dzOU+5dvOB+6qkpHYGFLM69ZtTcjE5pZ/03C6 d8ZlIb1AS+ofqDIDIocWuTnTvc083LdeTZ4uevhNj6M8vC1rNllAT5JopWXl09owb2yh 4a3SH9IL+0CIhRvHjR+lJDAn8Tn+oOY++w7LdYTfuLCG3/wuFq+m/iSvhGeg6LPaCVC4 a8GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jf6Zjsgx; 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 w7si14950835edj.96.2019.11.18.21.48.43; Mon, 18 Nov 2019 21:48:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Jf6Zjsgx; 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 S1731403AbfKSFsk (ORCPT + 26 others); Tue, 19 Nov 2019 00:48:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:45230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727805AbfKSFsh (ORCPT ); Tue, 19 Nov 2019 00:48:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD69B218BA; Tue, 19 Nov 2019 05:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142517; bh=oA0SjtyPdBmFx777on6n0gmKh9e4CxtsuhtGwP5lMsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jf6ZjsgxQJ4b0HZtDjegAsuE1l5L0ae4oYPOYetb/PgJll9GLkghoUhVvnHnSFaX5 wc2b1IZNz85KkdM3bVp4BCsM2Vyy4QVFWFo4KSsrPN3SwltLO6+KA12xBgY1y4UCer MWxRtEo2fONuPw41ZrQL+C/83CvBQEJx756AMoGo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 108/239] media: dvb: fix compat ioctl translation Date: Tue, 19 Nov 2019 06:18:28 +0100 Message-Id: <20191119051327.014243236@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051255.850204959@linuxfoundation.org> References: <20191119051255.850204959@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 1ccbeeb888ac33627d91f1ccf0b84ef3bcadef24 ] The VIDEO_GET_EVENT and VIDEO_STILLPICTURE was added back in 2005 but it never worked because the command number is wrong. Using the right command number means we have a better chance of them actually doing the right thing, though clearly nobody has ever tried it successfully. I noticed these while auditing the remaining users of compat_time_t for y2038 bugs. This one is fine in that regard, it just never did anything. Fixes: 6e87abd0b8cb ("[DVB]: Add compat ioctl handling.") Signed-off-by: Arnd Bergmann Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- fs/compat_ioctl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index ea52b98b39fa1..033e8e6aabb77 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -161,6 +161,7 @@ struct compat_video_event { unsigned int frame_rate; } u; }; +#define VIDEO_GET_EVENT32 _IOR('o', 28, struct compat_video_event) static int do_video_get_event(struct file *file, unsigned int cmd, struct compat_video_event __user *up) @@ -172,7 +173,7 @@ static int do_video_get_event(struct file *file, if (kevent == NULL) return -EFAULT; - err = do_ioctl(file, cmd, (unsigned long)kevent); + err = do_ioctl(file, VIDEO_GET_EVENT, (unsigned long)kevent); if (!err) { err = convert_in_user(&kevent->type, &up->type); err |= convert_in_user(&kevent->timestamp, &up->timestamp); @@ -191,6 +192,7 @@ struct compat_video_still_picture { compat_uptr_t iFrame; int32_t size; }; +#define VIDEO_STILLPICTURE32 _IOW('o', 30, struct compat_video_still_picture) static int do_video_stillpicture(struct file *file, unsigned int cmd, struct compat_video_still_picture __user *up) @@ -213,7 +215,7 @@ static int do_video_stillpicture(struct file *file, if (err) return -EFAULT; - err = do_ioctl(file, cmd, (unsigned long) up_native); + err = do_ioctl(file, VIDEO_STILLPICTURE, (unsigned long) up_native); return err; } @@ -1476,9 +1478,9 @@ static long do_ioctl_trans(unsigned int cmd, return rtc_ioctl(file, cmd, argp); /* dvb */ - case VIDEO_GET_EVENT: + case VIDEO_GET_EVENT32: return do_video_get_event(file, cmd, argp); - case VIDEO_STILLPICTURE: + case VIDEO_STILLPICTURE32: return do_video_stillpicture(file, cmd, argp); case VIDEO_SET_SPU_PALETTE: return do_video_set_spu_palette(file, cmd, argp);