Skip to content

Commit

Permalink
ovsdb-idl: Fix use-after-free when destroying an IDL loop.
Browse files Browse the repository at this point in the history
Transactions that are still incomplete (waiting for a reply from the
server) are kept in the IDL's 'outstanding_txns' map.  When a transaction
is destroyed, ovsdb_idl_txn_destroy() will take care of removing the
transaction from the 'outstanding_txns' map if the transaction was
incomplete but also abort it and disassemble it if needed.

Aborting the transaction first, before ovsdb_idl_txn_destroy(), may
cause an use-after-free if the transaction was outstanding; that's
because the transaction would move to state "aborted" without being
removed from the 'outstanding_txns' map.

Fixes: 53a540e ("ovsdb-idl: ovsdb_idl_loop_destroy must also destroy the committing txn.")
Signed-off-by: Dumitru Ceara <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
dceara authored and igsilya committed Feb 16, 2022
1 parent 31dc72c commit 4628be9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/ovsdb-idl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4243,7 +4243,6 @@ ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *loop)
{
if (loop) {
if (loop->committing_txn) {
ovsdb_idl_txn_abort(loop->committing_txn);
ovsdb_idl_txn_destroy(loop->committing_txn);
}
ovsdb_idl_destroy(loop->idl);
Expand Down

0 comments on commit 4628be9

Please sign in to comment.