vRouter Extension crashes while scanning fragments table

Bug #1793299 reported by Dariusz Sosnowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Dariusz Sosnowski
OpenContrail
Fix Committed
Undecided
Unassigned

Bug Description

This bug affects Contrail Windows vRouter Extension.

Disabling vRouter Extension on Windows can trigger a bluescreen in fragment assembly module.

vr_delete_timer cancels a timer without waiting for a scheduled
callback. This caused a data race (letter in parenthesis is thread ID):

- (A) disable extension operation starts;
- (A) VrAssemblerExit is called;
- (B) scheduled callback starts executing;
- (A) vr_delete_timer called in vr_assembler_table_scan_exit cancels a timer
      and returns immediately;
- (A) VrAssemblerExit frees VrAssemblerTable;
- (B) memory pointed to by VrAssemblerTable is accessed and extension
      bug checks;

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/46309
Submitter: Dariusz Sosnowski (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/46309
Committed: http://github.com/Juniper/contrail-vrouter/commit/4049fbb1201be4e099c21d921c0829e1907f1c5f
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 4049fbb1201be4e099c21d921c0829e1907f1c5f
Author: Dariusz Sosnowski <email address hidden>
Date: Wed Sep 19 13:04:43 2018 +0200

windows: Synchronize deleting timers with timer callbacks

vr_delete_timer cancels a timer without waiting for a scheduled
callback. This caused a data race (letter in parenthesis is thread ID):

- (A) disable extension operation starts;
- (A) VrAssemblerExit is called;
- (B) scheduled callback starts executing;
- (A) vr_delete_timer called in vr_assembler_table_scan_exit cancels a timer
and returns immediately;
- (A) VrAssemblerExit frees VrAssemblerTable;
- (B) memory pointed to by VrAssemblerTable is accessed and extension
bug checks;

To fix this we instruct ExDeleteTimer to wait for completion of scheduled
callbacks.

Besides that, this change introduces:

- a few asserts of IRQLs or NULL pointer accesses;
- error value return from vr_assembler_table_scan_init.

Change-Id: I9e8c9d3a7aa9231aba6816ac9a55634a38de16ea
Closes-Bug: #1793299

Changed in opencontrail:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.