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
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Dec 8 2022, 10:15 PM
Parents
rGf954ea26a615: zdb: Handle theoretical buffer overflow when printing float
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG242a5b748cbf: Fix dereference after null check in enqueue_range (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Dec 8 2022, 10:15 PM