Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1993687yba; Thu, 25 Apr 2019 08:58:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWjEgQU9hviC63qeMa915MZnTz/BbM8rVWTGNlFJjw1trmCvNd6LobOj9kSoV3xawioncf X-Received: by 2002:a17:902:43a4:: with SMTP id j33mr40431738pld.307.1556207897716; Thu, 25 Apr 2019 08:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556207897; cv=none; d=google.com; s=arc-20160816; b=CPJbMbQk9jWvYv49MuFVeAuDR8hUopFEOvTz+hA4SHNmkaz0EQ8LfcjtvKzjcxqnHL aint1AP7kNq6uq1xOI2ohI+Eldz/WdCj5OcJPScKkkhj8kFnkfwipUxA+t72RfT3S1Ml F5JDRqCp/JQlXl8g3iCJ8WOZ03j59D5ga4AypdO1DdLmTjyNxd20qMG69EFglRvdiotS qwcJPyUi0xgUE9+u58la6ITi8tF20riZSBH0+Yyw82yTScvJmRGjDrh8F4blHevSLc/0 o5O7HHjPUNRo5FzrjS8zoyzNOD9ZFr/9x/zHaYVI32wXlG97ZgmDNW2A3BzCFWZFjetQ qH4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Fkl8xjcBzkEDAJDtsVfc9hqu4DuBxNpnEcFovOy6vuY=; b=tnbWiWJLCRd65rv7/CdrUSwXegN412Bs87bcLlf9dd9Ob/tYPP5I635K09BQNuFGM3 Jv5xTGK3cr289oFyEb73MP0VdDH5WYMYZxjbSRZoXh6JFrlXZwxqVMpMlfP30bD/sHIY 2Mtk3AsNqwh+IAWPDtHcvyrKp7Zbf3UDhnJPnb0dR7Ex2BgP9dWXXImWOsS+y3UAjNY0 2o+0Ezz3cE+eMEfg/SIje3a7UKGGL5DAgYMSaWabhzOH/OmUDui8QWIoUhxf8YLRUvC3 gM2V3XCaBzCRxiR7dUToQ4N6HPgYXMHJJrifjlAw+9cq492t06RSptB6Z4BAj8upobz1 r4tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 t9si22151170plo.98.2019.04.25.08.58.03; Thu, 25 Apr 2019 08:58:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728896AbfDYPft (ORCPT + 99 others); Thu, 25 Apr 2019 11:35:49 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:47236 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfDYPfr (ORCPT ); Thu, 25 Apr 2019 11:35:47 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hJgPO-0002EI-Tp; Thu, 25 Apr 2019 15:35:35 +0000 Date: Thu, 25 Apr 2019 16:35:34 +0100 From: Al Viro To: Mauro Carvalho Chehab Cc: Arnd Bergmann , linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Jason Gunthorpe , Daniel Vetter , Greg Kroah-Hartman , David Sterba , Darren Hart , Jonathan Cameron , Bjorn Andersson , devel@driverdev.osuosl.org, qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-remoteproc@vger.kernel.org, sparclinux@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Sean Young Subject: Re: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl Message-ID: <20190425153534.GS2217@ZenIV.linux.org.uk> References: <20190416202013.4034148-1-arnd@arndb.de> <20190416202701.127745-1-arnd@arndb.de> <20190425122153.450fc094@coco.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190425122153.450fc094@coco.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote: > If I understand your patch description well, using compat_ptr_ioctl > only works if the driver is not for s390, right? No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl and be done with that; compat_ptr() is a no-op anyway" breaks. IOW, s390 is the reason for having compat_ptr_ioctl() in the first place; that thing works on all biarch architectures, as long as all stuff handled by ->ioctl() takes pointer to arch-independent object as argument. IOW, argument ignored => OK any arithmetical type => no go, compat_ptr() would bugger it pointer to int => OK pointer to string => OK pointer to u64 => OK pointer to struct {u64 addr; char s[11];} => OK pointer to long => needs explicit handler pointer to struct {void *addr; char s[11];} => needs explicit handler pointer to struct {int x; u64 y;} => needs explicit handler on amd64 For "just use ->unlocked_ioctl for ->ioctl" we have argument ignored => OK any arithmetical type => OK any pointer => instant breakage on s390, in addtion to cases that break with compat_ptr_ioctl(). Probably some form of that ought to go into commit message for compat_ptr_ioctl() introduction...