mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
pnfs/blocklayout: reject too long signatures
Instead of overwriting kernel memory reject too long signatures. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
68596bd188
commit
2bd3c63a33
1 changed files with 5 additions and 0 deletions
|
@ -65,6 +65,11 @@ nfs4_block_decode_volume(struct xdr_stream *xdr, struct pnfs_block_volume *b)
|
|||
return -EIO;
|
||||
p = xdr_decode_hyper(p, &b->simple.sigs[i].offset);
|
||||
b->simple.sigs[i].sig_len = be32_to_cpup(p++);
|
||||
if (b->simple.sigs[i].sig_len > PNFS_BLOCK_UUID_LEN) {
|
||||
pr_info("signature too long: %d\n",
|
||||
b->simple.sigs[i].sig_len);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
p = xdr_inline_decode(xdr, b->simple.sigs[i].sig_len);
|
||||
if (!p)
|
||||
|
|
Loading…
Reference in a new issue