From patchwork Fri May 5 11:57:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98621 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp81009qge; Fri, 5 May 2017 04:57:49 -0700 (PDT) X-Received: by 10.99.167.3 with SMTP id d3mr2802459pgf.70.1493985469487; Fri, 05 May 2017 04:57:49 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si5159094pfo.181.2017.05.05.04.57.49; Fri, 05 May 2017 04:57:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751435AbdEEL5o (ORCPT + 6 others); Fri, 5 May 2017 07:57:44 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:64881 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbdEEL5n (ORCPT ); Fri, 5 May 2017 07:57:43 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lj2j8-1ddBzN0nuw-00dExn; Fri, 05 May 2017 13:57:35 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Date: Fri, 5 May 2017 13:57:23 +0200 Message-Id: <20170505115725.1424772-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505115725.1424772-1-arnd@arndb.de> References: <20170505115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ner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We get a warning about a broken pointer conversion on 64-bit architectures: drivers/message/i2o/i2o_config.c: In function 'i2o_cfg_passthru': drivers/message/i2o/i2o_config.c:893:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (p->virt, (void __user *)sg[i].addr_bus, ^ drivers/message/i2o/i2o_config.c:953:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] ((void __user *)sg[j].addr_bus, sg_list[j].virt, ^ This has clearly never worked right, so we can add an #ifdef around the code. The driver was moved to staging in linux-4.0 and finally removed in 4.2, so upstream does not have a fix for it. The driver originally got this mostly right, though probably by accident. Fixes: f4c2c15b930b ("[PATCH] Convert i2o to compat_ioctl") Signed-off-by: Arnd Bergmann --- drivers/message/i2o/i2o_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 04bd3b6de401..67ceb3010a10 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c @@ -772,7 +772,7 @@ static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, #endif -#ifdef CONFIG_I2O_EXT_ADAPTEC +#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT) static int i2o_cfg_passthru(unsigned long arg) { struct i2o_cmd_passthru __user *cmd = @@ -1045,7 +1045,7 @@ static long i2o_cfg_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) ret = i2o_cfg_evt_get(arg, fp); break; -#ifdef CONFIG_I2O_EXT_ADAPTEC +#if defined(CONFIG_I2O_EXT_ADAPTEC) && !defined(CONFIG_64BIT) case I2OPASSTHRU: ret = i2o_cfg_passthru(arg); break;