git: usr.sbin/makefs/hammer2: Fix use-after-free caused by unmodified inode
Tomohiro Kusumi
tkusumi at crater.dragonflybsd.org
Tue Jun 20 00:10:00 PDT 2023
commit 1dc6036fc98bd355cdad303f3572aa7267471a57
Author: Tomohiro Kusumi <tkusumi at netbsd.org>
Date: Tue Jun 20 00:28:19 2023 -0700
usr.sbin/makefs/hammer2: Fix use-after-free caused by unmodified inode
Fix another bug only seen on OpenBSD.
Unlike regular makefs usage for image creation, ioctl commands don't
always modify all in-memory inodes. These unmodified inodes get freed
in makefs vflush() via hammer2_inode_drop() on unmount before PFS sync,
but they need to outlive chains.
Add per-PFS reclaim list to keep all inodes intact during unmount
process until PFS is ready to be freed.
Summary of changes:
usr.sbin/makefs/hammer2/hammer2.h | 3 +++
usr.sbin/makefs/hammer2/hammer2_inode.c | 41 ++++++++++----------------------
usr.sbin/makefs/hammer2/hammer2_vfsops.c | 24 +++++++++++++++----
3 files changed, 36 insertions(+), 32 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1dc6036fc98bd355cdad303f3572aa7267471a57
--
DragonFly BSD source repository
More information about the Commits
mailing list