-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug in traverse_visitbp #2060
Comments
@tuxoko I suspect your right. I'd have expected the TRAVERSE_PRE and TRAVERSE_POST calls to pass the same We'll certainly not want to loose take of this and take a closer look. Thanks for filing an issue. |
Could this be the same issue?
ii dkms 2.2.0.3-1.1ubuntu4+zfs1 uname -aLinux v302 3.11.0-15-generic #25-Ubuntu SMP Thu Jan 30 17:22:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux |
I just deadlocked Interestingly, backup_cb appears in the stack trace:
|
@ryao So we might want to just "fixed" this and close this issue. |
Closing. For the reason described in the previous comment. |
@behlendorf |
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. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#2060
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. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#2060
Hi all:
dmu_traverse.c L306:
dnp = buf->b_data;
It modifies the input argument
dnp
.and
dmu_traverse.c L367:
(void) arc_buf_remove_ref(buf, &buf);
dnp
now becomes possible dangling pointer.and later
dmu_traverse.c L371:
err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
dnp
is accessed again.This seems to be a bug to me.
Any comment?
The text was updated successfully, but these errors were encountered: