summaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs
diff options
context:
space:
mode:
authorNikola Livic <nlivic@gmail.com>2021-03-29 11:56:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-22 10:40:31 +0200
commitc621f3654bba1096ec913d0942e27bd032bb6090 (patch)
tree59f385616672d918c6518a1fe5c3260084ec3ab1 /fs/ecryptfs
parent6e15fb6cb6ac678786e98f673ac5ba1bc33e319b (diff)
downloadlinux-stable-c621f3654bba1096ec913d0942e27bd032bb6090.tar.gz
linux-stable-c621f3654bba1096ec913d0942e27bd032bb6090.tar.bz2
linux-stable-c621f3654bba1096ec913d0942e27bd032bb6090.zip
pNFS/flexfiles: fix incorrect size check in decode_nfs_fh()
[ Upstream commit ed34695e15aba74f45247f1ee2cf7e09d449f925 ] We (adam zabrocki, alexander matrosov, alexander tereshkin, maksym bazalii) observed the check: if (fh->size > sizeof(struct nfs_fh)) should not use the size of the nfs_fh struct which includes an extra two bytes from the size field. struct nfs_fh { unsigned short size; unsigned char data[NFS_MAXFHSIZE]; } but should determine the size from data[NFS_MAXFHSIZE] so the memcpy will not write 2 bytes beyond destination. The proposed fix is to compare against the NFS_MAXFHSIZE directly, as is done elsewhere in fs code base. Fixes: d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver") Signed-off-by: Nikola Livic <nlivic@gmail.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ecryptfs')
0 files changed, 0 insertions, 0 deletions