Commit b4487b9
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: aa9c266 ("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>1 parent d474f96 commit b4487b9
2 files changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5856 | 5856 | | |
5857 | 5857 | | |
5858 | 5858 | | |
5859 | | - | |
5860 | | - | |
5861 | 5859 | | |
5862 | 5860 | | |
5863 | 5861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4166 | 4166 | | |
4167 | 4167 | | |
4168 | 4168 | | |
4169 | | - | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
4170 | 4174 | | |
4171 | 4175 | | |
4172 | 4176 | | |
| |||
0 commit comments