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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D33CFC433E1 for ; Sun, 26 Jul 2020 16:37:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B66E2204EA for ; Sun, 26 Jul 2020 16:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726117AbgGZQhQ (ORCPT ); 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-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@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 ;-) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 4/4] quota: simplify the quotactl compat handling Date: Sun, 26 Jul 2020 17:37:11 +0100 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 Return-path: Content-Disposition: inline In-Reply-To: <20200726163422.GA24657-jcswGhMUV9g@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Christoph Hellwig Cc: x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Jan Kara , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-arch.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 ;-) 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56622C433DF for ; Sun, 26 Jul 2020 16:38:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 21E0C204EA for ; Sun, 26 Jul 2020 16:38:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OJaCSu5W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21E0C204EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8feLE202n+tJ9aLdTzXrq5C5FJQYv6uISv18wFI1spA=; b=OJaCSu5W672MBrblFEUpoJrQU AHLg2LKBXawQ4+X0uA4qgl7VtsA/yfplY2B3DK0Q3uSEVzN4OcSZ/RX9E94dfOVr2o/DCwebQ4fms boJbv/9waeb3dFmspoR5Y3GBmi2YHBNZgVEnmeiS+eqsI+giRTiydWp1ug3peEhdv/68bJeu91m+m lkyW8Hz3Zb2KClSQSse6KI7tAfqUR01dmaD6XWrGBehdID2iu8uWSt6flQeoBa6E19dhl0pmNjM78 ELWDMcJ9K3F+S2ieQV7/fg8cvPx0nzNPTNjjY2bZJoDfluu5qW+XvdTRDPSRRQZtT2yPNRC46vloK LjChiUnkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzjeJ-0007xc-F0; Sun, 26 Jul 2020 16:37:19 +0000 Received: from [2002:c35c:fd02::1] (helo=ZenIV.linux.org.uk) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzjeG-0007wU-T2 for linux-arm-kernel@lists.infradead.org; Sun, 26 Jul 2020 16:37:17 +0000 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 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-Disposition: inline In-Reply-To: <20200726163422.GA24657@lst.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200726_123716_978808_35D78282 X-CRM114-Status: GOOD ( 15.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Jan Kara , linux-fsdevel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 ;-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel