mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
Zero end of embedded block buffer in dump_write_embedded()
This fixes a kernel stack leak. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Tested-by: Nicholas Sherlock <n.sherlock@gmail.com> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #13778 Closes #14255
This commit is contained in:
parent
9be34ec99e
commit
f3f5263f8a
@ -584,7 +584,13 @@ dump_write_embedded(dmu_send_cookie_t *dscp, uint64_t object, uint64_t offset,
|
||||
|
||||
decode_embedded_bp_compressed(bp, buf);
|
||||
|
||||
if (dump_record(dscp, buf, P2ROUNDUP(drrw->drr_psize, 8)) != 0)
|
||||
uint32_t psize = drrw->drr_psize;
|
||||
uint32_t rsize = P2ROUNDUP(psize, 8);
|
||||
|
||||
if (psize != rsize)
|
||||
memset(buf + psize, 0, rsize - psize);
|
||||
|
||||
if (dump_record(dscp, buf, rsize) != 0)
|
||||
return (SET_ERROR(EINTR));
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user