]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: fix an incorrect limit in filelayout_decode_layout()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 11 May 2021 08:49:42 +0000 (11:49 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 20 May 2021 16:17:08 +0000 (12:17 -0400)
commitba8b7f4b2f235bbe8965a20fd3a369da5e36bf17
tree939cab969061c04a2ff9927cb98473f0517d7367
parentf80ecfd087100523f76c745db420015b3b2d38ac
NFS: fix an incorrect limit in filelayout_decode_layout()

The "sizeof(struct nfs_fh)" is two bytes too large and could lead to
memory corruption.  It should be NFS_MAXFHSIZE because that's the size
of the ->data[] buffer.

I reversed the size of the arguments to put the variable on the left.

Fixes: 7f56d17585ea ("NFSv4.1: pnfs: filelayout: add driver's LAYOUTGET and GETDEVICEINFO infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/filelayout/filelayout.c