HomeFreeBSD

Fix dereference after null check in enqueue_range

Description

Fix dereference after null check in enqueue_range

If the bp is NULL, we have a hole. However, when we build with
assertions, we will dereference bp when blkid == DMU_SPILL_BLKID. When
this happens on a hole, we will have a NULL pointer dereference.

Reported-by: Coverity (CID-1524670)
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14264

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Dec 4 2022, 9:31 PM
Tony Hutter <hutter2@llnl.gov>Committed on Jan 19 2023, 8:50 PM
Parents
rGe23ed1b3307f: Fix potential buffer overflow in zpool command
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rG24a6d8316a16: Fix dereference after null check in enqueue_range (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Jan 19 2023, 8:50 PM