<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>The patch itself looks fine, so:</p>
<p>Reviewed-by: Maxim Patlasov <a class="moz-txt-link-rfc2396E"
href="mailto:mpatlasov@virtuozzo.com"><mpatlasov@virtuozzo.com></a></p>
<br>
As for patch description, its last paragraph looks misleading. We
seem to be safe only until RHEL reuses name_index == 9 (what was
EXT4_XATTR_INDEX_TRUSTED_CSUM in the v1 of the patch). I think it
would be more honest to state it clearly: we do not support
pfcache-ed ploop images from rh7-3.10.0-327.28.2.vz7.17.10.<br>
<br>
Thanks,<br>
Maxim<br>
<br>
<div class="moz-cite-prefix">On 09/27/2016 08:31 AM, Pavel
Tikhomirov wrote:<br>
</div>
<blockquote
cite="mid:1474990308-27655-1-git-send-email-ptikhomirov@virtuozzo.com"
type="cite">
<pre wrap="">Need it to be able to rsync xattrs for encripted containers which
have pfcache_csum disabled on superblock.
When there is no PFCACHE_CSUM on superblock or we are not
capable(CAP_SYS_ADMIN), we do not allow get/set trusted.pfcache.
So hide trusted.pfcache from list also in thouse two cases.
Tested that: list/get xattr "trusted.pfcache" is OK on file
setxattred on vz7.17.11 kernel, xattr entry on which had wrong
e_name_index (reverted EXT4_XATTR_INDEX_TRUSTED_CSUM), works as
there is no such entry at all. As in ext4_xattr_list_entries
-> ext4_xattr_handler where is special check for it.
v2: do checks in ext4_xattr_trusted_list which is used for
listing trusted.xxx xattrs
<a class="moz-txt-link-freetext" href="https://jira.sw.ru/browse/PSBM-52180">https://jira.sw.ru/browse/PSBM-52180</a>
Signed-off-by: Pavel Tikhomirov <a class="moz-txt-link-rfc2396E" href="mailto:ptikhomirov@virtuozzo.com"><ptikhomirov@virtuozzo.com></a>
---
fs/ext4/xattr_trusted.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/ext4/xattr_trusted.c b/fs/ext4/xattr_trusted.c
index 49dd83f..131b6b8 100644
--- a/fs/ext4/xattr_trusted.c
+++ b/fs/ext4/xattr_trusted.c
@@ -19,6 +19,11 @@ ext4_xattr_trusted_list(struct dentry *dentry, char *list, size_t list_size,
        const size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
+        if (!strcmp(name, EXT4_DATA_CSUM_NAME) &&
+         (!capable(CAP_SYS_ADMIN) ||
+         !test_opt2(dentry->d_inode->i_sb, PFCACHE_CSUM)))
+                return 0;
+
        if (!ve_capable(CAP_SYS_ADMIN))
                return 0;
</pre>
</blockquote>
<br>
</body>
</html>