Bug 13156 - Race condition in schema_load init
Summary: Race condition in schema_load init
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.7.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-21 04:10 UTC by Garming Sam
Modified: 2018-10-31 20:46 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.
Comment 2 Garming Sam 2018-10-31 20:46:56 UTC
Fixed in master with 17f1c6f9f4c6d14c69d0d7030fcd919fbc0f6231