Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5210573ybi; Tue, 30 Jul 2019 16:12:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0OE0DVXe8bGna9eqC132ptSWZ90r97o4ZZIJwn1qLCqK2iOg79GtkSdMCosVxzdvGfxWH X-Received: by 2002:a63:2cd5:: with SMTP id s204mr93750763pgs.95.1564528358875; Tue, 30 Jul 2019 16:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564528358; cv=none; d=google.com; s=arc-20160816; b=K2NCwTv4O5JJpzn4LfbPlIV5Mslu2o/t4oRj3PGNuyR/bIZiI7TJwB+8NY+SrOdMM5 knQBUY9AgtajpT6P9Hs1SEL3vbpar54eXL97gdmOyF6fR0dOjce9UCW0CP25OvBI6DQy Us7agdUAb9R3i2mUnW/IGK9XamQUJiWBBEqt+4b9p3T7MuSHD6GE1c8jXC8V9fO1WtTN UNLp+XuOZnNPOqD0cjCXHfA8wHvxcbAGwVB2dQkQIi+S3Xf+kB33K/hl8TMfrRekxc0E VpUPMOwEjOFG8rObXihJvet7DLUHSgvLWXeJ6KPxERsUzQ7yIhD/CkbMQ+LcK3U4RNuK 1G9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5RzApq6XFoztBnIqNk8vSnTrtbUfODyGJJfunMohfoM=; b=Wc3ThB9tccnjqEkZdhLpQVN0ZmFx1KmRC3TVySiaXBEBz8Z49NsskPcG0MBSo48uc/ cMugJroRltdB0LTNq8/odBsRy8BTHh6lSO5Co6CIMD7id2NmYBR0IYegKi4rJhf6O4P4 /pV1pRPzd7Pwf1wJ+3DZDurzajZ81CGCInBg2uEzoZR3h8eARDQ0tthMuGb+SQ3FZHll IOfdZo0Ie8gE9xWU9K6m8doR4lBENuOUyQEczo7gm4gRlEpqESMkrKr2eHy/wHssGoJW /GeCpVuT1rj4EH1O35/Wtml7TEskwvkHYaCaTcezjUs3sOr7RVAu7fa3PwMRtygeBPw2 +JjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Zwx0RQpM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si19179800pgr.196.2019.07.30.16.12.23; Tue, 30 Jul 2019 16:12:38 -0700 (PDT) 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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Zwx0RQpM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbfG3UPG (ORCPT + 99 others); Tue, 30 Jul 2019 16:15:06 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:44942 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbfG3UPF (ORCPT ); Tue, 30 Jul 2019 16:15:05 -0400 Received: by mail-ot1-f68.google.com with SMTP id b7so17508431otl.11 for ; Tue, 30 Jul 2019 13:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5RzApq6XFoztBnIqNk8vSnTrtbUfODyGJJfunMohfoM=; b=Zwx0RQpMg/Mqj/9z5S89A3ZEJVMpYC9h+xxOXAaZcuU5PCAM8m9Gqaz//RnKDBGDqW 9liyDLB1BwWzU+ZNcxIkUlAhEM4dwaxEWMetA5zngGXxvLUm9KzmX8yqMCHjIc+8qA1I 4Kz3jT1Z/FAcCfiuMTNuiLT9z2kiwc9S0x8YZz6OVlR8h69bqZIY4y5U2CziwyfAHt6S 8CcPZTmDK53Mwk0qwS3iX6X/MjsfAEfTAQNYo9qJOCNeLP9BFCn9fMgZ4bp/B5yi3zOB uh6pK4X9QLjcA5W2PzdnflMG8qYA3C40MW87vpeyNAEv23qLtzsWi1Ofnp3dkIf+XH59 Buzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5RzApq6XFoztBnIqNk8vSnTrtbUfODyGJJfunMohfoM=; b=XfFMKASWDwbS1tfH6/aGzAkgYma3mT7QzZ+k8Vk0HL6JvUrV2z2rirPYHwMGbDOliw D6atRhiu1qGnIPYzOPhwM4Z8uf+ukrGbYmdO4gC57jVpdbZbt/n5Hpp0vxA7R88dFVbH dqyA6WUgHhfY4mbaP7f57OvR0oTvGitZHAI2FjRo+IEPJUiKYq08Eg6Woz3SVdn6GWIg hc0Ak1n1piL9Iz1aUy3uPkZvJA5ilTznm8lbLHleJ2TiWVuWMVhlc2+EPpJ2bB2JSE2r dQM5MHOB71W0sYu92oWH6uh036M+jlSNANkvB8fqVx/4cIA3bnqpuKXZDhePDk+j8D01 6VSw== X-Gm-Message-State: APjAAAVJrIxnTQGesEfIUOqapeLOstGnSt3iWaJY0hf2ixBb8A5pqa3C 41RgyWDawwYO7OiavMDUax1zMXtMSQ6LTPWn69HJUQ== X-Received: by 2002:a9d:7248:: with SMTP id a8mr23671169otk.363.1564517704838; Tue, 30 Jul 2019 13:15:04 -0700 (PDT) MIME-Version: 1.0 References: <20190730192552.4014288-1-arnd@arndb.de> <20190730195819.901457-1-arnd@arndb.de> In-Reply-To: <20190730195819.901457-1-arnd@arndb.de> From: Dan Williams Date: Tue, 30 Jul 2019 13:14:52 -0700 Message-ID: Subject: Re: [PATCH v5 13/29] compat_ioctl: move more drivers to compat_ptr_ioctl To: Arnd Bergmann Cc: Alexander Viro , linux-iio@vger.kernel.org, Daniel Vetter , linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, Bjorn Andersson , sparclinux@vger.kernel.org, Mauro Carvalho Chehab , linux-scsi , linux-nvdimm , linux-rdma , qat-linux@intel.com, amd-gfx list , Jason Gunthorpe , linux-input@vger.kernel.org, Darren Hart , "Linux-media@vger.kernel.org" , linux-remoteproc@vger.kernel.org, "moderated list:DMA BUFFER SHARING FRAMEWORK" , Maling list - DRI developers , Jonathan Cameron , David Sterba , platform-driver-x86@vger.kernel.org, Greg Kroah-Hartman , USB list , Linux Wireless List , Linux Kernel Mailing List , tee-dev@lists.linaro.org, linux-crypto , Netdev , linux-fsdevel , linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 12:59 PM Arnd Bergmann wrote: > > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390 architecture, where a compat pointer is only > 31 bit wide, and converting it into a 64-bit pointer requires calling > compat_ptr(). Most drivers here will never run in s390, but since we now > have a generic helper for it, it's easy enough to use it consistently. > > I double-checked all these drivers to ensure that all ioctl arguments > are used as pointers or are ignored, but are not interpreted as integer > values. > > Acked-by: Jason Gunthorpe > Acked-by: Daniel Vetter > Acked-by: Mauro Carvalho Chehab > Acked-by: Greg Kroah-Hartman > Acked-by: David Sterba > Acked-by: Darren Hart (VMware) > Acked-by: Jonathan Cameron > Acked-by: Bjorn Andersson > Signed-off-by: Arnd Bergmann > --- > drivers/nvdimm/bus.c | 4 ++-- [..] > diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c > index 798c5c4aea9c..6ca142d833ab 100644 > --- a/drivers/nvdimm/bus.c > +++ b/drivers/nvdimm/bus.c > @@ -1229,7 +1229,7 @@ static const struct file_operations nvdimm_bus_fops = { > .owner = THIS_MODULE, > .open = nd_open, > .unlocked_ioctl = bus_ioctl, > - .compat_ioctl = bus_ioctl, > + .compat_ioctl = compat_ptr_ioctl, > .llseek = noop_llseek, > }; > > @@ -1237,7 +1237,7 @@ static const struct file_operations nvdimm_fops = { > .owner = THIS_MODULE, > .open = nd_open, > .unlocked_ioctl = dimm_ioctl, > - .compat_ioctl = dimm_ioctl, > + .compat_ioctl = compat_ptr_ioctl, > .llseek = noop_llseek, > }; Acked-by: Dan Williams