Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6023237ybc; Wed, 27 Nov 2019 13:34:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx+aH13he5H1D3m0rntmrBsB+/p7BTx8eTeUtomT6NNGAphxB2c0X8D93VQfTKz43RPreOK X-Received: by 2002:a05:6402:1543:: with SMTP id p3mr35347007edx.304.1574890477108; Wed, 27 Nov 2019 13:34:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890477; cv=none; d=google.com; s=arc-20160816; b=0pYbEupz3l5KQFrzDuW5i00LE/9QpsM+UiPC5YhweQhVUm88jjepwkuCkhG+8h389Q QSGLO+Ck6fIqncvp4+39QLrkx2O+5QNeOOG8wokOBLEDFVUo/qKk/Ua2f0iDm8LAy1PF jqRb7EeTzw0QTqqNYuZIvRDlcfE9GZOomYHJGCsXblIpOWVJKt3MOG0QLf63aOdNBwtK +Weju0WNmBhlwhJlwr5iS7VUqqT4cDUhPi88RsuoZt91UdoSNtx+SUNaiD+IFyG9JNPV YQvKxtpGeZmPnWWNsR6aLrJR01z1x0A8ImL8UJG/s9qTOnv76mKOhDoeUnT9MY4G51K1 wdxQ== 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=SyFvtBlob83nn62/styKu7KkBgwsrAxUv8VtAXepC+U=; b=qAoJ6P1USe+Wdqd2QzzUb/YSfD9C5Tfc6cDxaMpw1+J0YfNT2peAVz375FGwAwiTqa UKxOYftqHEtBEMji6X2DqeWR8YAa3I9VCok1sInE3AZkGSZPGZRUVnhv1bezciOTUbtN YS74FV0Z0HDMK0hLz3MYAfbib7/5YwUt2z9MKOLJjOSdNeWylP2UrK9h/t1N2o+TWS8N Mj/Ylc3piKpqXs1rQl7dhul/pYbw4uBOQ5bazn3m3270gNdTJnBl5gPNdJX6VzdhAPzo G7r+wuMP4lATSuvxBakrZFdJj7Yt1g1809U5l43y+zp43p83+OC2SdpM4GNTKAQHPpqA NtrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qPIBsMfM; 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 p24si9966049eja.385.2019.11.27.13.34.13; Wed, 27 Nov 2019 13:34:37 -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=qPIBsMfM; 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 S1728089AbfK0U4M (ORCPT + 99 others); Wed, 27 Nov 2019 15:56:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:46874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731030AbfK0U4H (ORCPT ); Wed, 27 Nov 2019 15:56:07 -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 EF72C2084D; Wed, 27 Nov 2019 20:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888167; bh=B7wpAoZb0vOP2wxAkqsNJK7GjdfckQh97xZRiHY1kRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qPIBsMfMIY/CVe5u56TmoJOW4D8niv7NGtwebhogE5I/0ea8Er4shTegcGpzDADqC ReQ3uitfnSN0eDxC1C9uaugsc3ADIFHz3MLRGQ5dg7ihjstndt4BzAJumgVNFuR47Q 4Tw1/dmo3rrnkNPlVUkpUiIIzg25F+0CerCdvSJ0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Viro , Sasha Levin Subject: [PATCH 4.19 030/306] synclink_gt(): fix compat_ioctl() Date: Wed, 27 Nov 2019 21:28:00 +0100 Message-Id: <20191127203116.924730296@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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