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

[Backport][ipa-4-6] Clear next field when returnining list elements in queue.c #2317

Closed

Conversation

flo-renaud
Copy link
Contributor

This PR was opened automatically because PR #2283 was pushed to master and backport to ipa-4-6 is required.

The ipa-otpd code occasionally removes elements from one queue,
inspects and modifies them, and then inserts them into
another (possibly identical, possibly different) queue.  When the next
pointer isn't cleared, this can result in element membership in both
queues, leading to double frees, or even self-referential elements,
causing infinite loops at traversal time.

Rather than eliminating the pattern, make it safe by clearing the next
field any time an element enters or exits a queue.

Related https://pagure.io/freeipa/issue/7262
@flo-renaud
Copy link
Contributor Author

PR was ACKed automatically because this is backport of PR #2283. Wait for CI to finish before pushing. In case of questions or problems contact @frozencemetery who is author of the original PR.

@flo-renaud flo-renaud added ack Pull Request approved, can be merged pushed Pull Request has already been pushed labels Aug 31, 2018
@flo-renaud
Copy link
Contributor Author

ipa-4-6:

  • b0b37d4 Clear next field when returnining list elements in queue.c
  • d0b23ec Add cmocka unit tests for ipa otpd queue code

@flo-renaud flo-renaud closed this Sep 3, 2018
@flo-renaud flo-renaud deleted the backport_pr2283_ipa-4-6 branch September 7, 2018 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
2 participants