-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix access to DBEntry after its deleted
Problem: When flow-mgmt-dbclient module gets FREE_DBENTRY event, the DBState was freed under following conditions, - gen_id in the DBState matches - DBEntry was in deleted state However, it misses following sequence of events 1. DBEntry is deleted gen_id set to 1 and DELETE_DBENTRY event enqueued The event is not yet notified by flow-mgmt module 2. DBEntry is added gen_id retained as 1 and ADD_DBENTRY event is enqueued 3. DBEntry is deleted again. The DBEntry is not notified yet 4. The DELETE_DBENTRY event is processed It will in-turn generate FREE_DBSTATE event 5. The FREE_DBSTATE event is processed before DBEntry delete in (3) is processed 6. The DBEntry delete is notified All clients remove their state even before event in (4) is processed DBEntry is freed 7. Event from (4) is procssed and enqueues CLEAR_DBSTATE enqueued again 8. CLEAR_DBSTATE event triggers ClearState for a freed-dbentry resulting in crash Fix: Maintain deleted_ flag in DBState and check for deleted_ flag before freeing DBState. With this change, the deleted_ flag will be reset in (2) and in (3), the DBState will not be freed Change-Id: I9d6617a4a7d74936f95372a00025e236684cf515 Closes-Bug: #1551577
- Loading branch information
Showing
8 changed files
with
165 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.