From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EC2DC433EF for ; Wed, 20 Jul 2022 04:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237282AbiGTE1c (ORCPT ); Wed, 20 Jul 2022 00:27:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiGTE1b (ORCPT ); Wed, 20 Jul 2022 00:27:31 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0AE76B75F for ; Tue, 19 Jul 2022 21:27:29 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 6108968BEB; Wed, 20 Jul 2022 06:27:26 +0200 (CEST) Date: Wed, 20 Jul 2022 06:27:26 +0200 From: Christoph Hellwig To: Nick Bowler Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH] nvme: Define compat_ioctl again to unbreak 32-bit userspace. Message-ID: <20220720042726.GA5574@lst.de> References: <20220720015538.15838-1-nbowler@draconx.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220720015538.15838-1-nbowler@draconx.ca> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2022 at 09:55:38PM -0400, Nick Bowler wrote: > Commit 89b3d6e60550 ("nvme: simplify the compat ioctl handling") removed > the initialization of compat_ioctl from the nvme block_device_operations > structures. > > Presumably the expectation was that 32-bit ioctls would be directed > through the regular handler but this is not the case: failing to assign > .compat_ioctl actually means that the compat case is disabled entirely, > and any attempt to submit nvme ioctls from 32-bit userspace fails > outright with -ENOTTY. I don't think wiring up the native version is the right thing to do, this needs to be blkdev_compat_ptr_ioctl, just like we use compat_ptr_ioctl for the character device nodes.