summaryrefslogtreecommitdiff
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorJeffrey Mitchell <jeffrey.mitchell@starlab.io>2020-09-16 00:42:52 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-09-16 19:25:14 +0300
commitd33030e2ee3508d65db5644551435310df86010e (patch)
treeffca5ae621d7abb9851010f756c3699f1610d61e /lib/debugobjects.c
parent856deb866d16e29bd65952e0289066f6078af773 (diff)
downloadlinux-d33030e2ee3508d65db5644551435310df86010e.tar.xz
nfs: Fix security label length not being reset
nfs_readdir_page_filler() iterates over entries in a directory, reusing the same security label buffer, but does not reset the buffer's length. This causes decode_attr_security_label() to return -ERANGE if an entry's security label is longer than the previous one's. This error, in nfs4_decode_dirent(), only gets passed up as -EAGAIN, which causes another failed attempt to copy into the buffer. The second error is ignored and the remaining entries do not show up in ls, specifically the getdents64() syscall. Reproduce by creating multiple files in NFS and giving one of the later files a longer security label. ls will not see that file nor any that are added afterwards, though they will exist on the backend. In nfs_readdir_page_filler(), reset security label buffer length before every reuse Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io> Fixes: b4487b935452 ("nfs: Fix getxattr kernel panic and memory overflow") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions