From patchwork Mon Aug 27 19:56:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 145209 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp341601ljw; Mon, 27 Aug 2018 12:57:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdakNx00jseMXvHrokg9SHTIH6KFkgOeQRS6QeMzQ23pqJ0e4wx89Ire2qAyEXnn2YOJIL1Z X-Received: by 2002:a62:990f:: with SMTP id d15-v6mr15758817pfe.162.1535399825033; Mon, 27 Aug 2018 12:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535399825; cv=none; d=google.com; s=arc-20160816; b=H6CwYWlcNi8qrH/X5AbWKTYTwKDBdvBw6MtLq6hKQQ24Jg8Zzhfdnm+q++d5iNUOdq m7ib58GLxl2iFb26rlNUoxoAD3NvxzYMa0aC16SIq0iqtADO6YFipTZN9h6wUG2QXmyk sb9cMHKb2+tZ0kp5QCxD1fnMijhhDZ2AGJqrZjGFcuOfqqcc8RkHu0uQWPB9Ca41vezU NQgtvuMOYJp9FS2ZA0d5ZZwbuW3JSLobBSE9jHXYDbLzmNcwU4z//sX5j/988BUfpBeo /npRNk9CKUTBUXu83E3ALnnmk0LUGgvkbwpcCp9EGwYnYzTgw3ni/fu2QnsOoEmRmxH0 ZcoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UEiifNQ0iUDWpsA31jQgNXYgcc4DhsRdH8Qsn4VzAII=; b=VJHj+75iM7RAfbo0yJg9XnibQa1YtQKB+WQpXtrdtZboKtVs8PvIbEsJxnCBBkNdri l69c7D1cVZz3TR7eMeFfr6ZM76oVGZZsxTu9DTZ2N6BZAttcrwgolt0MgH9K5iEyvV0T 4fPDl1QMNS3WvxoRjY8NOtTBjAmQBcVWzPcue9avA/jygx1hN6b9IlTknx5olt+Z5WVB kyBrtPfgiYMO+SSuENypQB10b60Ee7cfjukZrD0qdxktgJ55SMAhCGSntRWoT7MF2JW+ ylwAm+ImSi8Wg7wi4qzsJDsbEjUEJvRd79y2o8evUPICqYSDAiReEcroJKpdqhLFbwHp 3sNQ== 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 h9-v6si128016plk.461.2018.08.27.12.57.04; Mon, 27 Aug 2018 12:57:05 -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 S1727265AbeH0XpF (ORCPT + 32 others); Mon, 27 Aug 2018 19:45:05 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:34991 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbeH0XpF (ORCPT ); Mon, 27 Aug 2018 19:45:05 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MVasZ-1gR3Ln3AMR-00YzBc; Mon, 27 Aug 2018 21:56:52 +0200 From: Arnd Bergmann To: linux-media@vger.kernel.org Cc: y2038@lists.linaro.org, awalls@md.metrocast.net, hans.verkuil@cisco.com, mchehab@kernel.org, Arnd Bergmann , Alexander Viro , Mauro Carvalho Chehab , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] media: dvb: fix compat ioctl tramslation Date: Mon, 27 Aug 2018 21:56:21 +0200 Message-Id: <20180827195649.4170969-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:VS+pZMGgNlfsnNJAwaoMK+Q2vIFcxSIuYCX4pv+sU1RdZJ6em6n iTK/Z9W6Gd+Yz5jJv9bp00+JPno33PoGTuQ6VmMr9QxDkHHMzJkiel2BYDnqoqkbxxAp5FV 9GMNNo18bTq7PE8PumixwNOw4S6BXVlKeRIheJcb5aETZDfU2txkOX8U1ZQA6aABzDXBZ2I uHQIPz1nboHlO0NjnkOdw== X-UI-Out-Filterresults: notjunk:1; V01:K0:aGshKQyTFzM=:D8910VkZ+tDRT60GdWtwFp G23mWCF+8LIHz3FI1l0euo1BfXjMHgxe/gP7dm20LbJXoAqHPM7Uj+SuRkPvkrpTcx17d0W7C LEuHNLwG0wm8layj9YCCf0HFhYGgyUX22bSck6Zmds9pZJSl18KAcAId09IcHQTztYPYqMoI6 e7oD5f68JZz7YOnUKbD5FahS4CH2Knpa61OQaHjBuTY29EDQszwg9IewQN1VCTo/xeE3lnbsC E8ce5JeThwvkb6YF9GntdDnyRLlKvzF/CFGLIDH6A6pPFI0f/iayDwUGpx8dVfNV2VzmvBAET hE6w65Nkv199ZQftbdtvpOZ+rr5AU8jqXCueeRFwS+tY78VddDfFzLFAdSlN23xSUHmhysv6X 148Ngw+ZM31QbHTeg7BJIFG0p/EQO5OyhNdoPrUWW9rszJJypaUybheO4V2DXBYBfevV3MJIX HR5A/nfQP/8vnA1aBZSj25E7IB73UfpKxrpd64LCsuofx4/YxDREzHcx/Df6J1iZmLKTCoXfl PGAmQ+LHlAOmjK11caqi26mBIDJKT+dq8rKeT+PY7s5x052zAnQQNxhpkBWbEL93rfbDsu/+c HR0ilXfvxHDBzvidoY22O3Pd30NdaKEmqkXDwP61HUjZ5Z8Wq75NWoxfIWLmo4+rCmSeTiU6c vcb/IoxDJ1fp577ralgAWxArNS2+9dtJvkX5V6rOCxngqfC6zd7SBiMEsCAGbqadfBak= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/compat_ioctl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.18.0 diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index a9b00942e87d..0c46ce224590 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -141,6 +141,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) @@ -152,7 +153,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); @@ -171,6 +172,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) @@ -193,7 +195,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; } @@ -1305,9 +1307,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); }