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

#647: Fix use-after-free in celix_framework_scheduleEvent. #683

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

PengZheng
Copy link
Contributor

@PengZheng PengZheng commented Nov 3, 2023

I really should have fixed this before 2.4.0 release when reporting #647.

@pnoltes This needs to be backported to support/2.4

@PengZheng PengZheng linked an issue Nov 3, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

Merging #683 (709228b) into master (046e52a) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 709228b differs from pull request most recent head e98a6ec. Consider uploading reports for the commit e98a6ec to get more accurate results

@@            Coverage Diff             @@
##           master     #683      +/-   ##
==========================================
- Coverage   81.67%   81.66%   -0.01%     
==========================================
  Files         252      252              
  Lines       32602    32603       +1     
==========================================
- Hits        26627    26626       -1     
- Misses       5975     5977       +2     
Files Coverage Δ
libs/framework/src/framework.c 85.00% <100.00%> (+<0.01%) ⬆️

... and 2 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

celixThreadCondition_broadcast(&fw->dispatcher.cond); //notify dispatcher thread for newly added scheduled event
celixThreadMutex_unlock(&fw->dispatcher.mutex);

return celix_scheduledEvent_getId(event);
return id;
Copy link
Contributor Author

@PengZheng PengZheng Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing event id without lock protection leads to use-after-free.
I just ignored this last line when this was first encountered.

@PengZheng PengZheng merged commit c8d7ced into master Nov 4, 2023
28 checks passed
@PengZheng PengZheng deleted the hotfix/647-event-use-after-free branch November 4, 2023 08:26
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.

Use-after-free of ScheduledEvents
2 participants