Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp394108ybb; Sat, 28 Mar 2020 01:27:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsNhi5NdvTpckowpShjihFGku13lu96XOjc0lEjjejug81U/L8jazdf2tF9jA1/RhZg1TZ7 X-Received: by 2002:a9d:3d65:: with SMTP id a92mr1824544otc.326.1585384061125; Sat, 28 Mar 2020 01:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585384061; cv=none; d=google.com; s=arc-20160816; b=kMb2uFXUuBCjYSb3QOncuQI41MWEp0TYrGWv2Y1MGZ1fPZD0oTY0jerJmKYQSMzpn3 uxTesc86/JVrovejxe92dgaOFX53hTZghGagPCeR3BRPuWh6pM/6jz/ovPzfj/kcfiFu Jo3ar1AKM0uP14rn+CTE/Xlfoio/hb+RbQpnOFUHWZB9DWd0gNa5pKbLHjttOl3qU0SD nfDDv6TJCNd91rEXYvAoRp7FuLG6tbJT8Ze8AJkU6xvmdQmyFAF0eWxDN4nV54dC2+Tk 8xW4I8ZGMhPEbMI+sc2w+VDFFM1KewTlxbgcPkijV/lBz6aKzY7iZoWq332ZvegqOpyM GItA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=O13t8NusS3D/3XhZSEG+NS2S3e48ZOuJ7579C8SUUrE=; b=vmoaItdH36sAxwnfzpnBefZIGRdvsXrMsbKF9CrG3QbuCD7u6Oppfo3Lxh92YJknOm RAwcP8csVC21XFgUlfTo0DYP4BOCYbSPIdSvOc3SktStX8I3pAc+fTXukalHYgyoRzvJ iJlnpKOyT2+TeiI+4FoZrP8YIDv9hHbLX4f7CLLLaNJfGVpB85NIfnjyX8KeccXHc0Q6 AoSRv/30L/Sfz8kl6HssQudP+Uu3h1TDaJ07STq/9ELdqLd3K1FdY5UMxLAnMyAG6LHI 11uT+f1Wxs7dlWTqRxImQs84muNLZTnYNLKwCqFac+3P6urAStMGuNiodv7Btq8WAtK5 XkDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=WE6PYqk9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si3447857ott.228.2020.03.28.01.27.14; Sat, 28 Mar 2020 01:27:41 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=WE6PYqk9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726156AbgC1I0C (ORCPT + 99 others); Sat, 28 Mar 2020 04:26:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44008 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgC1I0B (ORCPT ); Sat, 28 Mar 2020 04:26:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=O13t8NusS3D/3XhZSEG+NS2S3e48ZOuJ7579C8SUUrE=; b=WE6PYqk9eLUmPmVbWiCJFE7PGM rnN7F6psV/9G31XGwvU7++iQxwAyDQPcLiYyr1BWvvPazkJzqQgpkbQ4gC4SxkZibgfUEwV5Gqx1D Ts7vJxJC9l4u878GIhM7g+K4R2d05d22j3akS7jhco/2UJuMYCmEw32fEhOyE8diRuVujECJGwyq/ HHWHtkorWVp3dGlLiGnle5+IdcdRNlrMHZvy/7exRBry6da2ZcMSJDG4MuKAAXc/foKrD9Yb/aGnL F+GbKPpiXIm3mzfnkqgJXWK3U10x3Q3lBZuJ7PmdfwlhxygUFaWH8EuXjXHuU9fgp8cs5OVFvRDZ7 RuORGq5g==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jI6n3-0003Uu-8G; Sat, 28 Mar 2020 08:26:01 +0000 Date: Sat, 28 Mar 2020 01:26:01 -0700 From: Christoph Hellwig To: Nick Bowler Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sagi Grimberg , Christoph Hellwig , Keith Busch Subject: Re: [PATCH v2 1/2] nvme: Fix compat NVME_IOCTL_SUBMIT_IO numbering Message-ID: <20200328082601.GA7658@infradead.org> References: <20200328050909.30639-1-nbowler@draconx.ca> <20200328050909.30639-2-nbowler@draconx.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200328050909.30639-2-nbowler@draconx.ca> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 28, 2020 at 01:09:08AM -0400, Nick Bowler wrote: > When __u64 has 64-bit alignment, the nvme_user_io structure has trailing > padding. This causes problems in the compat case with 32-bit userspace > that has less strict alignment because the size of the structure differs. > > Since the NVME_IOCTL_SUBMIT_IO macro encodes the structure size itself, > the result is that this ioctl does not work at all in such a scenario: > > # nvme read /dev/nvme0n1 -z 512 > submit-io: Inappropriate ioctl for device > > But by the same token, this makes it easy to handle both cases and > since the structures differ only in unused trailing padding bytes > we can simply not read those bytes. > > Signed-off-by: Nick Bowler I think we already have a similar patch titled "nvme: Add compat_ioctl handler for NVME_IOCTL_SUBMIT_IO" in linux-next, with the difference of actually implementing the .compat_ioctl entry point.