Skip to content

afr:prevent null pointer access in afr_notify#4645

Open
YifanZhang-311 wants to merge 1 commit intogluster:develfrom
YifanZhang-311:fix/afr-notify-null-ptr
Open

afr:prevent null pointer access in afr_notify#4645
YifanZhang-311 wants to merge 1 commit intogluster:develfrom
YifanZhang-311:fix/afr-notify-null-ptr

Conversation

@YifanZhang-311
Copy link

Add a check for the this->cleanup_starting flag at the beginning of afr_notify() to skip notifications for volumes that are undergoing finalization (fini). This prevents afr_has_quorum from accessing already freed this->private.

Fix: #4644

@YifanZhang-311 YifanZhang-311 force-pushed the fix/afr-notify-null-ptr branch 3 times, most recently from 3401c3a to 8f308d2 Compare December 26, 2025 07:58
@YifanZhang-311
Copy link
Author

Hi, @pranithk , could you please review this patch when you have a moment?

Thanks :)

@YifanZhang-311 YifanZhang-311 force-pushed the fix/afr-notify-null-ptr branch 2 times, most recently from a2d007f to d874703 Compare March 16, 2026 07:10
Protect afr_has_quorum with a lock to prevent access to
this->private which could be freed by glusterfs_graph_fini
in another thread.

Fixex: gluster#4644
@YifanZhang-311 YifanZhang-311 force-pushed the fix/afr-notify-null-ptr branch from d874703 to ce0f7fb Compare March 16, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Null pointer dereference in afr_notify() due to access after free in afr_has_quorum

1 participant