lkml.org 
[lkml]   [2020]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] quota: simplify the quotactl compat handling
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..

\
 
 \ /
  Last update: 2020-07-26 18:35    [W:0.087 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site