Skip to content

Commit

Permalink
afs: Fix warning due to unadvanced marshalling pointer
Browse files Browse the repository at this point in the history
[ Upstream commit c80afa1 ]

When using the afs.yfs.acl xattr to change an AuriStor ACL, a warning
can be generated when the request is marshalled because the buffer
pointer isn't increased after adding the last element, thereby
triggering the check at the end if the ACL wasn't empty.  This just
causes something like the following warning, but doesn't stop the call
from happening successfully:

    kAFS: YFS.StoreOpaqueACL2: Request buffer underflow (36<108)

Fix this simply by increasing the count prior to the check.

Fixes: f5e4546 ("afs: Implement YFS ACL setting")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
dhowells authored and gregkh committed Nov 18, 2020
1 parent 9946509 commit e201588
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/afs/yfsclient.c
Expand Up @@ -2162,6 +2162,7 @@ int yfs_fs_store_opaque_acl2(struct afs_fs_cursor *fc, const struct afs_acl *acl
memcpy(bp, acl->data, acl->size);
if (acl->size != size)
memset((void *)bp + acl->size, 0, size - acl->size);
bp += size / sizeof(__be32);
yfs_check_req(call, bp);

trace_afs_make_fs_call(call, &vnode->fid);
Expand Down

0 comments on commit e201588

Please sign in to comment.