]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zdb: zdb_ddt_leak_init() reads uninitialized memory when birth == 0
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Sat, 3 Dec 2022 20:09:48 +0000 (15:09 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 8 Dec 2022 22:15:10 +0000 (14:15 -0800)
commitd30db519af44b905fc52b8c8ba34f6378aa03470
tree43fc8ad7e7f3649f880920f1ed24d5a179987c3f
parent2709ace096b8448f07537f978863ad061cc3c7da
zdb: zdb_ddt_leak_init() reads uninitialized memory when birth == 0

This was written by Jeff Bonick and was committed to OpenSolaris on
November 1, 2009. It appears that Jeff meant to continue the outer loop
iteration when `ddp->ddp_phys_birth == 0`, but put his check inside the
inner loop. This causes a pointer to uninitialized memory to be passed
to ddt_lookup() inside a VERIFY() statement whenever that condition is
true.

Reported-by: Coverity (CID 1524462)
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
cmd/zdb/zdb.c