aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/freebsd/zfs/abd_os.c
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2021-09-17 13:17:18 -0400
committerGitHub <[email protected]>2021-09-17 10:17:18 -0700
commit139690d6c3c748b138525784dd6f0aa48cfcda1a (patch)
tree3d52e0cf1646172952206dd10e61ca061042a484 /module/os/freebsd/zfs/abd_os.c
parent2a49ebbb4dd0799ffa4fcb4043220a0f992aa68c (diff)
Really zero the zero page
While switching abd_zero_buf allocation KPI I've missed the fact that kmem_zalloc() zeroed the allocation, while kmem_cache_alloc() does not. Add explicit bzero() after it. I don't think it should have caused real problems, but leaking one memory page content all over the pool is not good. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Closes #12569
Diffstat (limited to 'module/os/freebsd/zfs/abd_os.c')
-rw-r--r--module/os/freebsd/zfs/abd_os.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/module/os/freebsd/zfs/abd_os.c b/module/os/freebsd/zfs/abd_os.c
index 8bc1ef132..fa1034ff8 100644
--- a/module/os/freebsd/zfs/abd_os.c
+++ b/module/os/freebsd/zfs/abd_os.c
@@ -250,6 +250,7 @@ abd_alloc_zero_scatter(void)
n = abd_chunkcnt_for_bytes(SPA_MAXBLOCKSIZE);
abd_zero_buf = kmem_cache_alloc(abd_chunk_cache, KM_PUSHPAGE);
+ bzero(abd_zero_buf, PAGE_SIZE);
abd_zero_scatter = abd_alloc_struct(SPA_MAXBLOCKSIZE);
abd_zero_scatter->abd_flags |= ABD_FLAG_OWNER | ABD_FLAG_ZEROS;