From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755435AbdEEUII (ORCPT ); Fri, 5 May 2017 16:08:08 -0400 Date: Fri, 5 May 2017 13:07:59 -0700 From: Greg KH To: Arnd Bergmann Cc: stable@vger.kernel.org Subject: Re: [PATCH 7/9] [3.18-stable] i2o: hide unsafe ioctl on 64-bit Message-ID: <20170505200759.GA19363@kroah.com> References: <20170505115725.1424772-1-arnd@arndb.de> <20170505115725.1424772-8-arnd@arndb.de> <20170505171312.GA19034@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Fri, May 05, 2017 at 08:36:55PM +0200, Arnd Bergmann wrote: > On Fri, May 5, 2017 at 7:13 PM, Greg KH wrote: > > On Fri, May 05, 2017 at 01:57:23PM +0200, Arnd Bergmann wrote: > >> 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. > > > > I fixed this in a different way, doing the cast to make things be quiet, > > as was done in other places in the driver. You were copied on that > > patch when it was added to my tree, right? > > I missed it when you sent it, but looking at it now, I think it introduces > another warning, on 32-bit architectures: > > - (p->virt, (void __user *)sg[i].addr_bus, > + (p->virt, (void __user > *)(u64)sg[i].addr_bus, > > I think you need '(void __user *)(uintptr_t)sg[i].addr_bus' to > shut up the warning for all builds. Ah good point. I've now dropped my version and taken yours instead :) thanks, greg k-h