Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1194955ybn; Wed, 2 Oct 2019 12:15:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8+YQ4NG1xss/pZJH1oAHVhrwbbKJdx0H5ZA/T1cmu0MC4RsKhSLelcm3YPTvVftcOmyfJ X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr4462453ejb.114.1570043718165; Wed, 02 Oct 2019 12:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570043718; cv=none; d=google.com; s=arc-20160816; b=wX5+bbc+sEy+xHHLAUORFoDJLEsCKieAbZBcY9vXe/tN30EyGE02osFdJehmaQzHSU nnUzZ5Rc/B2VXTG8VMIpAzPi2/G9Uv5SQwGnmdElzd8DvPGtBl7NYEKm8f/lkDaf2RMz 39tUmbDsU106bSVRtBOnet0WadOWpO8GKaLAlhc+LgcRnbHB9dFdO88f2X8gQZ0Ifo/J HVmdHxGp/Orz413x/bLrVxQ+khoeZnbKBf1xsgysX48URbE4L9ZMYaBDyHIL5kPSSQPt awXUzzzC8294cJM6q9cZD9W3wyBLkVwOZC7XTgPR9jumk9U/6dAIlJBYQ+72IaXTxExC QlAw== 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; bh=RSos7g7Ayu46Ujavxh1NMk7L8OjM0gQsBVs8PxQHIRs=; b=I0D0b5y+5MvAF/Ds3rqBBCgT0EHHo5kowsnFE9oUCxbOA2NorN12HrYuP2ijy+i1nG yqjplZShi7ldpEmd/SSS7Gt7w+tHnKemMLpZ4Ecr9XR8E73mDfrp8vb3fm7d9p5Bitd9 +0yA5yNmt7nhNcWAkTeb0bv/ZJ0ls+zhX9MlKEqvWUfqcIKXg79ANMlrIH4M0YXZADDH ZqGRIbTopQ2CHnYXxuug6nf7xdhIC4Q/3VK4FFvktf/bhwj5non0josN+kNQDpqMUsk8 rckyYcj+5k9dAOBQo+4qTUQ350B3STD20jN6SJ15j9r10iqBPl4FY8OpilK4JmqXT1N/ C83A== 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 a23si25223edj.201.2019.10.02.12.14.53; Wed, 02 Oct 2019 12:15:18 -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 S1730204AbfJBTNX (ORCPT + 99 others); Wed, 2 Oct 2019 15:13:23 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35332 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729084AbfJBTIJ (ORCPT ); Wed, 2 Oct 2019 15:08:09 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFjyo-00035n-BA; Wed, 02 Oct 2019 20:08:06 +0100 Received: from ben by deadeye with local (Exim 4.92.1) (envelope-from ) id 1iFjyn-0003bh-LK; Wed, 02 Oct 2019 20:08:05 +0100 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, Denis Kirjanov , "Pierre-Loup A. Griffais" , "Andrey Smirnov" , "Dmitry Torokhov" Date: Wed, 02 Oct 2019 20:06:51 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 23/87] Input: uinput - add compat ioctl number translation for UI_*_FF_UPLOAD In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 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.75-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Andrey Smirnov commit 7c7da40da1640ce6814dab1e8031b44e19e5a3f6 upstream. In the case of compat syscall ioctl numbers for UI_BEGIN_FF_UPLOAD and UI_END_FF_UPLOAD need to be adjusted before being passed on uinput_ioctl_handler() since code built with -m32 will be passing slightly different values. Extend the code already covering UI_SET_PHYS to cover UI_BEGIN_FF_UPLOAD and UI_END_FF_UPLOAD as well. Reported-by: Pierre-Loup A. Griffais Signed-off-by: Andrey Smirnov Signed-off-by: Dmitry Torokhov Signed-off-by: Ben Hutchings --- drivers/input/misc/uinput.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -908,13 +908,31 @@ static long uinput_ioctl(struct file *fi #ifdef CONFIG_COMPAT -#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t) +/* + * These IOCTLs change their size and thus their numbers between + * 32 and 64 bits. + */ +#define UI_SET_PHYS_COMPAT \ + _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t) +#define UI_BEGIN_FF_UPLOAD_COMPAT \ + _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload_compat) +#define UI_END_FF_UPLOAD_COMPAT \ + _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload_compat) static long uinput_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - if (cmd == UI_SET_PHYS_COMPAT) + switch (cmd) { + case UI_SET_PHYS_COMPAT: cmd = UI_SET_PHYS; + break; + case UI_BEGIN_FF_UPLOAD_COMPAT: + cmd = UI_BEGIN_FF_UPLOAD; + break; + case UI_END_FF_UPLOAD_COMPAT: + cmd = UI_END_FF_UPLOAD; + break; + } return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg)); }