fix(ovn): add use-after-free fix for en-sync-sb to null check patch#6326
fix(ovn): add use-after-free fix for en-sync-sb to null check patch#6326
Conversation
Add a missing `continue` statement in sync_changed_lbs() to prevent use-after-free access after hmap_remove and free of sb_lb entry. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Summary of ChangesHello @oilbeater, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical use-after-free vulnerability in the OVN 'northd' component. By introducing a 'continue' statement after deallocating memory, it ensures that freed resources are not subsequently accessed, thereby enhancing the stability and security of the system. The change specifically targets the 'sync_changed_lbs()' function to prevent potential crashes or undefined behavior. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request addresses a potential use-after-free vulnerability by adding a continue statement after freeing an sb_lb object. It also introduces null pointer checks before deleting sbrec_port_binding, sbrec_bfd, and sbrec_encap records, enhancing the robustness of the code. The changes appear to correctly resolve the identified issues.
|
|
||
| hmap_remove(&sb_lbs->entries, &sb_lb->key_node); | ||
| free(sb_lb); | ||
| + continue; |
There was a problem hiding this comment.
Pull Request Test Coverage Report for Build 22334427923Details
💛 - Coveralls |
Summary
continueinsync_changed_lbs()(northd/en-sync-sb.c) to prevent use-after-free afterhmap_removeandfree(sb_lb), avoiding subsequent access to the freed entry.sbrec_port_binding_delete,sbrec_bfd_delete, andsbrec_encap_deleteare preserved.Test plan
🤖 Generated with Claude Code