]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: Fix getxattr kernel panic and memory overflow
authorJeffrey Mitchell <jeffrey.mitchell@starlab.io>
Wed, 5 Aug 2020 17:23:19 +0000 (12:23 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 12 Aug 2020 13:46:22 +0000 (09:46 -0400)
commit4fc0fda92d04cce38a5e7baceaa4c77c9a61ddab
treee19a8f9cbb3f0a7540eb9106fe85b6982d07f439
parentcf8e7a5a6cb5a7f63b8ba02f01d6bf6e8b48d479
nfs: Fix getxattr kernel panic and memory overflow

Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough

Fixes: f28dd75f5eb4 ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean up duplicate test of label->len != 0]
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c
fs/nfs/nfs4xdr.c