All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Christoph Hellwig <hch@lst.de>
Cc: x86@kernel.org, Jan Kara <jack@suse.com>,
	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
Date: Sun, 26 Jul 2020 17:37:11 +0100	[thread overview]
Message-ID: <20200726163711.GU2786714@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20200726163422.GA24657@lst.de>

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 ;-)


WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
To: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Cc: x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Jan Kara <jack-IBi9RG/b67k@public.gmane.org>,
	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
Subject: Re: [PATCH 4/4] quota: simplify the quotactl compat handling
Date: Sun, 26 Jul 2020 17:37:11 +0100	[thread overview]
Message-ID: <20200726163711.GU2786714@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20200726163422.GA24657-jcswGhMUV9g@public.gmane.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 ;-)

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@zeniv.linux.org.uk>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-arch@vger.kernel.org, linux-api@vger.kernel.org,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Jan Kara <jack@suse.com>,
	linux-fsdevel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/4] quota: simplify the quotactl compat handling
Date: Sun, 26 Jul 2020 17:37:11 +0100	[thread overview]
Message-ID: <20200726163711.GU2786714@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20200726163422.GA24657@lst.de>

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

  reply	other threads:[~2020-07-26 16:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 16:03 improve compat handling for the i386 u64 alignment quirk Christoph Hellwig
2020-07-26 16:03 ` Christoph Hellwig
2020-07-26 16:03 ` [PATCH 1/4] arm64: stop using <asm/compat.h> directly Christoph Hellwig
2020-07-26 16:03   ` Christoph Hellwig
2020-07-30 17:34   ` Nathan Chancellor
2020-07-30 17:34     ` Nathan Chancellor
2020-07-31  8:41     ` Naresh Kamboju
2020-07-31  8:41       ` Naresh Kamboju
2020-07-26 16:03 ` [PATCH 2/4] compat: lift compat_s64 and compat_u64 to <linux/compat.h> Christoph Hellwig
2020-07-26 16:03   ` Christoph Hellwig
2020-07-29  6:08   ` [PATCH 2/4 v2] " Christoph Hellwig
2020-07-29  6:08     ` Christoph Hellwig
2020-07-26 16:04 ` [PATCH 3/4] compat: add a compat_need_64bit_alignment_fixup() helper Christoph Hellwig
2020-07-26 16:04   ` Christoph Hellwig
2020-07-26 16:04 ` [PATCH 4/4] quota: simplify the quotactl compat handling Christoph Hellwig
2020-07-26 16:04   ` Christoph Hellwig
2020-07-26 16:04   ` Christoph Hellwig
2020-07-26 16:32   ` Al Viro
2020-07-26 16:32     ` Al Viro
2020-07-26 16:34     ` Christoph Hellwig
2020-07-26 16:34       ` Christoph Hellwig
2020-07-26 16:37       ` Al Viro [this message]
2020-07-26 16:37         ` Al Viro
2020-07-26 16:37         ` Al Viro
2020-07-27 12:41   ` Jan Kara
2020-07-27 12:41     ` Jan Kara
2020-07-27 12:41     ` Jan Kara
2020-07-27 15:56     ` Al Viro
2020-07-27 15:56       ` Al Viro
2020-07-27 21:31       ` Jan Kara
2020-07-27 21:31         ` Jan Kara
2020-07-28  1:49         ` Al Viro
2020-07-28  1:49           ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200726163711.GU2786714@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hch@lst.de \
    --cc=jack@suse.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.