overlay: filter out xattr starts with "trusted.overlay."
authorXiong Zhou <xzhou@redhat.com>
Thu, 23 Feb 2017 09:42:43 +0000 (17:42 +0800)
committerEryu Guan <eguan@redhat.com>
Thu, 23 Feb 2017 10:40:56 +0000 (18:40 +0800)
commitddac6e07731832541c962b0df5c220975fddc2be
tree35f0493a320edbf98d5abb81b65a02fed40c5798
parent3eb12b45efa2afcdab9d6f12dfbed69ee44aa214
overlay: filter out xattr starts with "trusted.overlay."

Overlayfs should only filter out xattr starting with
"trusted.overlay.", not "trusted.overlay".

Setting xattrs like "trusted.overlay.xxx" is not allowed.
Setting xattrs like "trusted.overlayxxx" is allowed.

v4.8-rc1 introduced a regression that we can't set xattrs
like "trusted.overlayxxx".  Kernel commit below fixed it
in v4.8:
  fe2b75952347 ovl: Fix OVL_XATTR_PREFIX

This case tests both get/set of these 2 kinds of xattrs.

Pattern "trusted.overlay.xxx" should fail, however the
errno returned by set/get varies among kernel versions.

Pattern "trusted.overlayxxx" shold always work.

CC: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/overlay/026 [new file with mode: 0755]
tests/overlay/026.out [new file with mode: 0644]
tests/overlay/group