Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp779693ybc; Sat, 16 Nov 2019 08:33:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwgcDgKtBhp1pK2mDZjEyJGAnPvXq4BbGNsW43PL1lG/8TR/dXsejBDPVGigAdLsfbDDNhV X-Received: by 2002:a17:906:298b:: with SMTP id x11mr11150238eje.257.1573921984958; Sat, 16 Nov 2019 08:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921984; cv=none; d=google.com; s=arc-20160816; b=I3TFEcs8bzarze7LG60wwA8ikHl6EO/N07BW1T3qzwEV3rkPARJyEjiYcL7TIFsio+ 90P2Y0jF2f0oIm0CcqOUx1/NZowR96Vdy1lr0yT+7b2EDa7jxNLq8Mxrd9lsZnA/DAv8 MS+npqfC+oDA09EpXddXcY1NoTaeJuQjCgCXJ0HfcaItcLt3AcnH2xb2+IX/xjvlpF+X SesKmJgStQYo3TrNx8/QgOhZWpqv3oP6BSt/vNavY+6HV0T8sYKlSDtEw4zgCs4XbJQ3 jq5LHfmFsYT1BDYX9BGYnLFgpKNhuzoWGAjdG4yDbA43S6p1agHf8rrmsHWR7sc/kyqM dOdg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SyFvtBlob83nn62/styKu7KkBgwsrAxUv8VtAXepC+U=; b=JqbSkBehSVwIAGAUDGiJxdyEoL+ZTZCAmqmJ63fwgkabE6jFUG6Lv3hVWmyAs13F3H WSdVo+rZf6ZvBFu4yF7YgZT+hQZyLXM5ScPtC3Wrt+LU6yNG5gOMGFP0lKISSZ3ez/qL oOh4ouGnVVgkq9O95VH88XtxjmpZRXrm+Wk5+RTnIwS2SF49AxcFs1TCIvj9DrU1wEqw A4NuckdhEv1loEw/9u3a8LgUoc7CKwJzb9VFMbPPBF8GVclr80SoWWNvZd63jq2rkUqF 7ALYJt5zEeZDwzUpLVT+0oPKUITQcOtAPr6sXSpCX5SUBOlzaGEwKjnfsixqdaFQNi+A rU6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XXSYfzDR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si9288928eda.115.2019.11.16.08.32.39; Sat, 16 Nov 2019 08:33:04 -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=XXSYfzDR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728619AbfKPQ2U (ORCPT + 99 others); Sat, 16 Nov 2019 11:28:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:44304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbfKPPlT (ORCPT ); Sat, 16 Nov 2019 10:41:19 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E36582075C; Sat, 16 Nov 2019 15:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918879; bh=B7wpAoZb0vOP2wxAkqsNJK7GjdfckQh97xZRiHY1kRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXSYfzDRkvF6WNEC7poFoIp8482nk6po3OFJR+ykcWJCl5OcocUHGNLc/lZqiYPmR 56HW65A25IwIUqG285QZhYojCF6aew3RXo2fABFoAJf9VAfw5ZIx62f71A2foGnJgg JZBdCjyGf27QIans7IhLQbrRaKgDAbJzTPmGXbJo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Al Viro , Sasha Levin Subject: [PATCH AUTOSEL 4.19 009/237] synclink_gt(): fix compat_ioctl() Date: Sat, 16 Nov 2019 10:37:24 -0500 Message-Id: <20191116154113.7417-9-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro [ Upstream commit 27230e51349fde075598c1b59d15e1ff802f3f6e ] compat_ptr() for pointer-taking ones... Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- drivers/tty/synclink_gt.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index a94086597ebd6..b88ecf102764e 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -1186,14 +1186,13 @@ static long slgt_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { struct slgt_info *info = tty->driver_data; - int rc = -ENOIOCTLCMD; + int rc; if (sanity_check(info, tty->name, "compat_ioctl")) return -ENODEV; DBGINFO(("%s compat_ioctl() cmd=%08X\n", info->device_name, cmd)); switch (cmd) { - case MGSL_IOCSPARAMS32: rc = set_params32(info, compat_ptr(arg)); break; @@ -1213,18 +1212,11 @@ static long slgt_compat_ioctl(struct tty_struct *tty, case MGSL_IOCWAITGPIO: case MGSL_IOCGXSYNC: case MGSL_IOCGXCTRL: - case MGSL_IOCSTXIDLE: - case MGSL_IOCTXENABLE: - case MGSL_IOCRXENABLE: - case MGSL_IOCTXABORT: - case TIOCMIWAIT: - case MGSL_IOCSIF: - case MGSL_IOCSXSYNC: - case MGSL_IOCSXCTRL: - rc = ioctl(tty, cmd, arg); + rc = ioctl(tty, cmd, (unsigned long)compat_ptr(arg)); break; + default: + rc = ioctl(tty, cmd, arg); } - DBGINFO(("%s compat_ioctl() cmd=%08X rc=%d\n", info->device_name, cmd, rc)); return rc; } -- 2.20.1