]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix misuse of input argument in traverse_visitbp
authorsmh <smh@FreeBSD.org>
Tue, 28 Apr 2015 22:46:58 +0000 (22:46 +0000)
committersmh <smh@FreeBSD.org>
Tue, 28 Apr 2015 22:46:58 +0000 (22:46 +0000)
commita5d3a9fc065ad2352f5843e76a376a83abb8cf4f
tree481e7fbb1880d563f1c3f2cf7fed94e95ffe8426
parent1a6e28444393c716f36237cffbbe4b2cd048f09c
Fix misuse of input argument in traverse_visitbp

In traverse_visitbp(), the input argument dnp is modified in the middle
to point to a temporary buffer. Originally this doesn't matter, because
no user of TRAVERSE_POST dereferences it. However, in fbeddd6 a piece of
code is added dereferencing dnp after the modification, creating a possible
bug.

We fix this by creating a new local variable cdnp for the DMU_OT_DNODE case,
so we don't modify the input argument. Also we introduce different local
variables in the DMU_OT_OBJSET case to prevent confusion between the input
argument.

Obtained from: zfsonlinux (a585f2f844ed3d4270221fed88f5e494eb55d932)
MFC after: 2 weeks
Sponsored by: Multiplay
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c