-
Notifications
You must be signed in to change notification settings - Fork 14
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
app_rpt.c, rpt_cli.c, rpt_manager.c: Add missing mutex_lock() #512
app_rpt.c, rpt_cli.c, rpt_manager.c: Add missing mutex_lock() #512
Conversation
While reviewing code that generated this PR, I notice this: app_rpt/apps/app_rpt/rpt_link.c Lines 175 to 185 in 7b97e6c
I'm not positive, but I think we should be locked when adding to the list? Or maybe when calling |
Ah, that's a good point. It looks like it's using a linked list without a lock so some kind of locking does seem needed. |
2ce910a
to
2bee58f
Compare
50db7c8
to
6cd6bc3
Compare
…calls to __mklinklist()
6cd6bc3
to
7cb7bfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this change as an incremental improvement. But, we really need to take a step back and review/analyze/update all of the logic around myrpt
and the associated links.
Why? If you look at the call to __mklnklist
inside the periodic_process_links()
function you will see we are passing myrpt
and l
. Even if we lock myrpt
one can/should ask whether l
is still valid as it is captured from myrpt->links.next
at the top of the function and advanced at the end of the while() loop without holding any locks.
It appears these calls should be mutex_locked.