Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp446884ybg; Sun, 26 Jul 2020 09:35:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2xEB9GGmPBiVEAjSEwmgGw25AITdSshj5KpIWZXLmusykgLNJK9usiaNVmWuX7wqH1r6o X-Received: by 2002:a17:906:558b:: with SMTP id y11mr11493236ejp.378.1595781312111; Sun, 26 Jul 2020 09:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595781312; cv=none; d=google.com; s=arc-20160816; b=F8w/zGaUSsBfyfPWGJDcH/SuURhQAG/84RFH+5nWIfPl2U7baSHxL4vz2X2hsWnR+Q VUxFvrHUforgl409C+En0bCLsKMs3il9Dz+eU1+wVYQxIBpmg2n1rVwy2oTSs8Smvn+I A1aOHbWU3u1qCb199dXO54u4C0vTO86Uu79kZu0ONUFZ+QSWJfyKZqLx/9mokVyo+F11 wKbrmxIhq+8o3T173fn+CZhU2y3rY6vsPvpGqBmK4Dg2GkmI1CqKozqaUsaNdRNcka52 lblp0tMNyTDKLZ1udB+jOAAQhMeNFmKDgwXb3eJmiy8tgQcsM9jns5Kgdejq82YccRnt nnQA== 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=E3FZLCF1mZvNEwzhWasx76/xCHgUtnJ/cuEHFF6k068=; b=CoDR1dePKP08WaDUKHSmlsuhJ1RAzJgYdUhcFL4o4H1ytNAHer6o/Yiq4fpsXyM597 4eOh4Vc4QOKQZmcJYKrXwixJIOCYTo9gQ1arP7qA5mV9Oeyg3yqOCejdFYGv9JiDkub7 ue2p4gyNC5JinybNFfFtQzfyJ7JJHQyiqSF/YNFPmL2exkA1tlqdQXW/K+aQSmWMeAa1 ECEVWZr7Z6XakoXBgPAKKcYeNGMCgUBqa6FTXsY6+H4WE2eqR6eso4vf1DPfvTPt1h/l QA1dHHra63RyoNzy9Fy5uLoWpVz6/QxqnWZFTMqTP9kCQ6GxT7fif5UO3QmHTjATimcD MQFg== 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 y21si4356469edm.256.2020.07.26.09.34.50; Sun, 26 Jul 2020 09:35:12 -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 S1727991AbgGZQe0 (ORCPT + 99 others); Sun, 26 Jul 2020 12:34:26 -0400 Received: from verein.lst.de ([213.95.11.211]:40876 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbgGZQe0 (ORCPT ); Sun, 26 Jul 2020 12:34:26 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id BF3B368B05; Sun, 26 Jul 2020 18:34:22 +0200 (CEST) Date: Sun, 26 Jul 2020 18:34:22 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , 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: <20200726163422.GA24657@lst.de> References: <20200726160401.311569-1-hch@lst.de> <20200726160401.311569-5-hch@lst.de> <20200726163214.GS2786714@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200726163214.GS2786714@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) 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 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..