Skip to content
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

dht: fix asan use-after-free bug #4247

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

mohit84
Copy link
Contributor

@mohit84 mohit84 commented Oct 23, 2023

The client is throwing below stacktrace while asan is enabled. The client is facing an issue while application is trying to call removexattr in 2x1 subvol and non-mds subvol is down. As we can see in below stacktrace dht_setxattr_mds_cbk is calling dht_setxattr_non_mds_cbk and dht_setxattr_non_mds_cbk is trying to wipe local because call_cnt is 0 but dht_setxattr_mds_cbk is trying to access frame->local that;s why it is crashed.

x621000051c34 is located 1844 bytes inside of 4164-byte region [0x621000051500,0x621000052544) freed by thread T7 here:

Solution: Use switch instead of using if statement to wind a operation, in case of switch
the code will not try to access local after wind a operation for last dht subvol.

Fixes: #3732
Change-Id: I031bc814d6df98058430ef4de7040e3370d1c677
(Reviewed on upstream link #4242)

Fixex: #3732
Change-Id: I031bc814d6df98058430ef4de7040e3370d1c677
Signed-off-by: Mohit Agrawal [email protected]

The client is throwing below stacktrace while asan is enabled. The client is facing an
issue while application is trying to call removexattr in 2x1 subvol and non-mds subvol
is down. As we can see in below stacktrace dht_setxattr_mds_cbk is calling
dht_setxattr_non_mds_cbk and dht_setxattr_non_mds_cbk is trying to wipe local because
call_cnt is 0 but dht_setxattr_mds_cbk is trying to access frame->local that;s
why it is crashed.

x621000051c34 is located 1844 bytes inside of 4164-byte region [0x621000051500,0x621000052544) freed by thread T7 here:

Solution: Use switch instead of using if statement to wind a operation, in case of switch
          the code will not try to access local after wind a operation for last dht subvol.

> Fixes: gluster#3732
> Change-Id: I031bc814d6df98058430ef4de7040e3370d1c677
> (Reviewed on upstream link gluster#4242)

Fixex: gluster#3732
Change-Id: I031bc814d6df98058430ef4de7040e3370d1c677
Fixes: gluster#3732
Signed-off-by: Mohit Agrawal <[email protected]>
@mohit84
Copy link
Contributor Author

mohit84 commented Oct 23, 2023

/run regression

@gluster-ant
Copy link
Collaborator

1 test(s) failed
./tests/00-geo-rep/georep-basic-dr-rsync.t

0 test(s) generated core

2 test(s) needed retry
./tests/000-flaky/basic_afr_split-brain-favorite-child-policy.t
./tests/00-geo-rep/georep-basic-dr-rsync.t
https://build.gluster.org/job/gh_centos7-regression/3348/

@mohit84
Copy link
Contributor Author

mohit84 commented Oct 23, 2023

/run regression

@Shwetha-Acharya Shwetha-Acharya merged commit d2e159d into gluster:release-11 Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants