linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] getxattr: use correct xattr length
@ 2018-06-07 11:43 Christian Brauner
  2018-06-07 11:43 ` [PATCH 1/1] " Christian Brauner
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Brauner @ 2018-06-07 11:43 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel
  Cc: cjwatson, ebiederm, viro, serge, Christian Brauner

Hey,

When running in a container with a user namespace, if you call getxattr
with name = "system.posix_acl_access" and size % 8 != 4, then getxattr
silently skips the user namespace fixup that it normally does resulting in
un-fixed-up data being returned.
I think that the analysis that this is caused by
posix_acl_fix_xattr_to_user() being passed the total buffer size and not
the actual size of the xattr as returned by vfs_getxattr() is correct.
So this commit passes the actual length of the xattr as returned by
vfs_getxattr() down.

It might be worth considering making posix_acl_fix_xattr_userns() and
posix_acl_fix_xattr_to_user() return errors. Such that e.g.
posix_acl_xattr_count() errors can be caught in getxattr(). If that's
something we want I can send a follow-up patch.

More details of this can be found in
https://bugzilla.kernel.org/show_bug.cgi?id=199945

Thanks!
Christian

Christian Brauner (1):
  getxattr: use correct xattr length

 fs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-23 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 11:43 [PATCH 0/1] getxattr: use correct xattr length Christian Brauner
2018-06-07 11:43 ` [PATCH 1/1] " Christian Brauner
2018-06-13 15:45   ` Serge E. Hallyn
2018-06-13 16:42     ` Christian Brauner
2018-07-23 15:00     ` Christian Brauner
2018-07-23 15:14       ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).