]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
9ccd3703ab67b3ba8906565375376e293e6907b8
[thirdparty/kernel/stable-queue.git] /
1 From 6a1cdf298ca7e03f036321ffc8debb13eacdc317 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
5
6 From: David Howells <dhowells@redhat.com>
7
8 [ Upstream commit c80afa1d9c3603d5eddeb8d63368823b1982f3f0 ]
9
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:
16
17 kAFS: YFS.StoreOpaqueACL2: Request buffer underflow (36<108)
18
19 Fix this simply by increasing the count prior to the check.
20
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>
25 ---
26 fs/afs/yfsclient.c | 1 +
27 1 file changed, 1 insertion(+)
28
29 diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c
30 index d21cf61d86b9f..3b19b009452a2 100644
31 --- a/fs/afs/yfsclient.c
32 +++ b/fs/afs/yfsclient.c
33 @@ -2162,6 +2162,7 @@ int yfs_fs_store_opaque_acl2(struct afs_fs_cursor *fc, const struct afs_acl *acl
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);
39
40 trace_afs_make_fs_call(call, &vnode->fid);
41 --
42 2.27.0
43