-
Notifications
You must be signed in to change notification settings - Fork 546
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
Fix the stack-overflow issue in AclOrch::getTableById() #1073
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In case the table_id and m_mirrorTableId/m_mirrorTableId are empty The function would be called recursively without ending. Signed-off-by: Zhenggen Xu <[email protected]>
Signed-off-by: Zhenggen Xu <[email protected]>
Hi, do you know why a rule would be inserted without a table name? |
stcheng
reviewed
Sep 29, 2019
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.
could you share if you have some ACL table configurations?
retest this please |
1 similar comment
retest this please |
stcheng
suggested changes
Oct 14, 2019
lguohan
approved these changes
Jan 29, 2020
lguohan
pushed a commit
that referenced
this pull request
Jan 30, 2020
* Fix the stack-overflow issue in AclOrch::getTableById() In case the table_id and m_mirrorTableId/m_mirrorTableId are empty The function would be called recursively without ending. ``` If we have some rule that does not have table defined, it will trigger this issue. (gdb) bt #0 0x00007f77ac5af3a9 in swss::Logger::write (this=0x7f77ac801ec0 <swss::Logger::getInstance()::m_logger>, prio=swss::Logger::SWSS_DEBUG, fmt=0x7f77ac5f1690 ":> %s: enter") at logger.cpp:209 #1 0x00000000004a5792 in AclOrch::getTableById (this=this@entry=0x1c722a0, table_id="") at aclorch.cpp:2617 #2 0x00000000004a59d1 in AclOrch::getTableById (this=this@entry=0x1c722a0, table_id="") at aclorch.cpp:2634 #3 0x00000000004a59d1 in AclOrch::getTableById (this=this@entry=0x1c722a0, table_id="") at aclorch.cpp:2634 ... #20944 0x00000000004a59d1 in AclOrch::getTableById (this=this@entry=0x1c722a0, table_id="") at aclorch.cpp:2634 #20945 0x00000000004ad3ce in AclOrch::doAclRuleTask (this=this@entry=0x1c722a0, consumer=...) at aclorch.cpp:2437 #20946 0x00000000004b04cd in AclOrch::doTask (this=0x1c722a0, consumer=...) at aclorch.cpp:2141 #20947 0x00000000004231b2 in Orch::doTask (this=0x1c722a0) at orch.cpp:369 #20948 0x000000000041c4e9 in OrchDaemon::start (this=this@entry=0x1c19960) at orchdaemon.cpp:376 #20949 0x0000000000409ffc in main (argc=<optimized out>, argv=0x7ffe2e392d68) at main.cpp:295 (gdb) p table_id $1 = "" (gdb) p m_mirrorTableId $2 = "" (gdb) p m_mirrorV6TableId $3 = "" ``` Signed-off-by: Zhenggen Xu <[email protected]>
EdenGri
pushed a commit
to EdenGri/sonic-swss
that referenced
this pull request
Feb 28, 2022
…net#1073) Update SONiC envvars file when loading minigraph. signed-off-by: Tamer Ahmed <[email protected]>
oleksandrivantsiv
pushed a commit
to oleksandrivantsiv/sonic-swss
that referenced
this pull request
Mar 1, 2023
HLD: sonic-net/SONiC#1020 **Why I did it?** FlexCounter class is a representation of flex counter group which supports querying multiple types of statistic/attributes. It supports multiple statistic/attribute types such as port counter, port debug counter, queue counter, queue attribute and so on. For each statistic/attribute type, it defines several member functions: - setXXXCounterList: e.g. setPortCounterList, setPortDebugCounterList - removeXXX: e.g. removePort, removeQueue - collectXXXCounters: e.g. collectPortCounters, collectQueueCounters - collectXXXAttr: e.g. collectQueueAttrs, collectPriorityGroupAttrs - so on - For different statistic/attribute types, these functions have very similar logic. This PR moved similar logic to single place to avoid redundant code. **How I test it?** Almost full unit test coverage of newly added code.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the stack-overflow issue in AclOrch::getTableById()
In case the table_id and m_mirrorTableId/m_mirrorTableId are empty
The function would be called recursively without ending.
Signed-off-by: Zhenggen Xu [email protected]
What I did
Fix the potential issue where the function AclOrch::getTableById() could be called recursively without ending.
Why I did it
If we have some rule that does not have table defined, it will trigger this issue.
How I verified it
Insert this ACL RULE
"ACL_RULE": {
"|RULE1": {
"IP_TYPE": "IPv4ANY",
"PACKET_ACTION": "DROP",
"PRIORITY": "0"
}
}
It will crash orchagent and produce the stack trace as above.
After the fix, the crash is gone.
Details if related