Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp449091ybg; Sun, 26 Jul 2020 09:39:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn6cScbf7+5YoH3qCrBeO/bOX8mpafL1DU7uMvbkVTo6bxiL7IBOgpYY32+0eNpU5/ni9R X-Received: by 2002:a17:906:d158:: with SMTP id br24mr12479286ejb.420.1595781595969; Sun, 26 Jul 2020 09:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595781595; cv=none; d=google.com; s=arc-20160816; b=aD/abae3hnGLHalUs66S/pWX+tK1CR4ykfqOp+9SF5GCj85vnw9BwcK09h+HM1qrX8 EcG0hrnVqHOySu5Tc/92baxx9uqIJVMElL//16XuvRSaS13246j+HOdIH7Qphl8iiSEd pYx3D/8SEkYdjr5aZNIn7E5tJbDElvlNiXJTHLiPPv6b2vxyyan6mixcnYgBaJwyeNrC 1nEJg0SCU7FeiCAJkdqfLHDLl3sOqjYQ4cgKeprxaeDrLr6wP48BBfXK3P85U9CYHJHQ 8fPNujD88xauSOwmy5fh1dTeC4VZck8zqA5kBO0SfFxsK4lbDZ2a2WNqSQAK1AisQgPz nXuQ== 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; bh=qBFFyBig3PWqlmoUbG4b9GUZMIqywD05n61+TpL28PU=; b=0BDmplYuicuT0AtgtE6oF5CcOrULUt6ASsYDrXpYlvSkZ5wpWa8vxcmDPled6BfaUE GQsfVMvI/s/Q0eUDWxc4ml+iGOAqld/oI9AeWShp/lnqED/ZKX1JJvMUc+rbhcATkibH ka25xpZikMI5rfvLH1QRlmupmWs7uKmNSEYw+9opY4tXxtpTwwBsISCVGOhdBHMtQCYH 1mq1knhON85DgneS3gWLf5Y9MSv6imC9sP0gWaSgi4tUmiqH/19vCtac4p2lGfoUxiBo c51bH7SPafaqyIY7mDheZeOLym2CUqbUc29hWj5pSPOvC0dXsuKl37/oqPX7O9mHOIjQ sWCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md1si4047928ejb.749.2020.07.26.09.39.32; Sun, 26 Jul 2020 09:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbgGZQhQ (ORCPT + 99 others); Sun, 26 Jul 2020 12:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbgGZQhQ (ORCPT ); Sun, 26 Jul 2020 12:37:16 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8DA5C0619D2; Sun, 26 Jul 2020 09:37:15 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzjeB-00367e-9C; Sun, 26 Jul 2020 16:37:11 +0000 Date: Sun, 26 Jul 2020 17:37:11 +0100 From: Al Viro To: Christoph Hellwig Cc: x86@kernel.org, Jan Kara , linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 4/4] quota: simplify the quotactl compat handling Message-ID: <20200726163711.GU2786714@ZenIV.linux.org.uk> References: <20200726160401.311569-1-hch@lst.de> <20200726160401.311569-5-hch@lst.de> <20200726163214.GS2786714@ZenIV.linux.org.uk> <20200726163422.GA24657@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200726163422.GA24657@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 26, 2020 at 06:34:22PM +0200, Christoph Hellwig wrote: > On Sun, Jul 26, 2020 at 05:32:14PM +0100, Al Viro wrote: > > > +static int compat_copy_fs_qfilestat(struct compat_fs_qfilestat __user *to, > > > + struct fs_qfilestat *from) > > > +{ > > > + if (copy_to_user(to, from, sizeof(*to)) || > > > + put_user(from->qfs_nextents, &to->qfs_nextents)) > > > + return -EFAULT; > > > + return 0; > > > +} > > > > do we have any need of that put_user()? Note that you don't even call > > that thing unless compat_need_64bit_alignment_fixup() is true. And AFAICS > > all such cases are little-endian... > > The main reason it is there is to preserve the previous semantics. > And no, I don't think we actually need it on x86. But what if some > poor souls adds a BE version that needs this? E.g. arm oabi has similar > weird alignment, and now imagine someone adding arm64 compat code for > that.. I'd probably add /* just in case some poor sod fucks up the same way for big-endian biarch */ next to that put_user(), then ;-)