Bug 13156 - Race condition in schema_load init
Race condition in schema_load init
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB
4.7.2
All All
: P5 normal
: ---
Assigned To: Andrew Bartlett
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-21 04:10 UTC by Garming Sam
Modified: 2017-11-22 00:51 UTC (History)
2 users (show)

See Also:


Attachments
Patch to fix the race condition (in the tests) (16.75 KB, patch)
2017-11-22 00:51 UTC, Garming Sam
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Garming Sam 2017-11-21 04:10:50 UTC
Between there is no lock around dsdb_schema_set_indices_and_attributes, attributes can be added or removed during processing. This leads to errors like the following during selftest:

dsdb_schema_set_indices_and_attributes: Failed to set schema into @ATTRIBUTES: attribute '@TEST_EXTRA': no such attribute for delete on '@ATTRIBUTES'
module schema_load initialization failed : No such attribute
module dsdb_notification initialization failed : No such attribute
module rootdse initialization failed : No such attribute
module samba_dsdb initialization failed : No such attribute
Comment 1 Garming Sam 2017-11-22 00:51:34 UTC
Created attachment 13801 [details]
Patch to fix the race condition (in the tests)

Tested manually with `while make test TESTS=schema_attributes; do :; done`

Previously, this would fail every now and again, but with the patches, it no longer happens.