1 From 0dc642a8ddb13c450c95d681e2001a090abd9b2d Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 3 Nov 2020 16:32:58 +0000
4 Subject: afs: Fix warning due to unadvanced marshalling pointer
6 From: David Howells <dhowells@redhat.com>
8 [ Upstream commit c80afa1d9c3603d5eddeb8d63368823b1982f3f0 ]
10 When using the afs.yfs.acl xattr to change an AuriStor ACL, a warning
11 can be generated when the request is marshalled because the buffer
12 pointer isn't increased after adding the last element, thereby
13 triggering the check at the end if the ACL wasn't empty. This just
14 causes something like the following warning, but doesn't stop the call
15 from happening successfully:
17 kAFS: YFS.StoreOpaqueACL2: Request buffer underflow (36<108)
19 Fix this simply by increasing the count prior to the check.
21 Fixes: f5e4546347bc ("afs: Implement YFS ACL setting")
22 Signed-off-by: David Howells <dhowells@redhat.com>
23 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
26 fs/afs/yfsclient.c | 1 +
27 1 file changed, 1 insertion(+)
29 diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c
30 index 3b1239b7e90d8..bd787e71a657f 100644
31 --- a/fs/afs/yfsclient.c
32 +++ b/fs/afs/yfsclient.c
33 @@ -1990,6 +1990,7 @@ void yfs_fs_store_opaque_acl2(struct afs_operation *op)
34 memcpy(bp, acl->data, acl->size);
35 if (acl->size != size)
36 memset((void *)bp + acl->size, 0, size - acl->size);
37 + bp += size / sizeof(__be32);
38 yfs_check_req(call, bp);
40 trace_afs_make_fs_call(call, &vp->fid);