Skip to content

Commit

Permalink
Leaving dirty zp caused unintended consequences
Browse files Browse the repository at this point in the history
Lower conditionals would check zp instead of
vp, causing it to enter conditionals assuming
vp is not NULL.

Easily triggered by opening Zone.Identifier with a
RelatedFileObject.

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Dec 18, 2023
1 parent 5acf767 commit 2442735
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/os/windows/zfs/zfs_vnops_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,10 @@ zfs_vnop_lookup_impl(PIRP Irp, PIO_STACK_LOCATION IrpSp, mount_t *zmo,
// assign "dvp" - but
// the stream_name check below will expect it in "vp".
// dvp_no_rele is already set.
dprintf("special case Zone.Identifier\n");
dvp_no_rele = 1;
vp = FileObject->RelatedFileObject->FsContext;
zp = VTOZ(vp);
dvp = NULL;
VERIFY0(VN_HOLD(vp));

Expand Down Expand Up @@ -1221,6 +1223,7 @@ zfs_vnop_lookup_impl(PIRP Irp, PIO_STACK_LOCATION IrpSp, mount_t *zmo,
if (dvp && !dvp_no_rele)
VN_RELE(dvp);
vp = NULL;
zp = NULL;
dvp = ZTOV(dzp);
int direntflags = 0; // To detect ED_CASE_CONFLICT
error = zfs_dirlook(dzp, stream_name, &zp, FIGNORECASE,
Expand Down

0 comments on commit 2442735

Please sign in to comment.