Bug 8921 - race writing registry values
Summary: race writing registry values
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Printing (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 8554
  Show dependency treegraph
 
Reported: 2012-05-09 09:14 UTC by Gregor Beck (550 Unknown user)
Modified: 2021-02-11 14:00 UTC (History)
2 users (show)

See Also:
obnox: review+


Attachments
patchset against v3-6-test (43.40 KB, patch)
2012-05-09 09:36 UTC, Gregor Beck (550 Unknown user)
asn: review+
obnox: review+
Details
script to reprocuce the race (4.29 KB, application/x-shellscript)
2012-05-10 08:17 UTC, Michael Adam
no flags Details
corresponding script for torturing createkey (5.10 KB, application/x-shellscript)
2012-05-10 08:20 UTC, Michael Adam
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gregor Beck (550 Unknown user) 2012-05-09 09:14:36 UTC
There is a race condition while writing registry values which may lead to values magicaly disapear while concurently writing values to the same registry key.
This may also affect creation of subkeys.
Comment 1 Gregor Beck (550 Unknown user) 2012-05-09 09:36:31 UTC
Created attachment 7535 [details]
patchset against v3-6-test

backported from master
Comment 2 Andreas Schneider 2012-05-09 12:19:45 UTC
Comment on attachment 7535 [details]
patchset against v3-6-test

I've reviewed the patchset again for 3.6 and it looks fine to me.

I've also pushed it to:

https://git.samba.org/?p=asn/samba.git;a=shortlog;h=refs/heads/registry_fixes_36
Comment 3 Michael Adam 2012-05-10 08:14:33 UTC
Comment on attachment 7535 [details]
patchset against v3-6-test

ACK. Thanks for backporting the fixes!

I just tested them with v3-6-test. Works like a charm.
Comment 4 Michael Adam 2012-05-10 08:17:36 UTC
Created attachment 7546 [details]
script to reprocuce the race

For reference: With the attached script, one can easily trigger the setvalue race when the patchset is not applied.

Call something like this:

TDB_NOFSYNC=1 NET_BIN="./bin/net" NET_OPTIONS=" -s /some/path/to/smb.conf" NUM_PARALLEL=8 ~/tmp/test_torture_net_registry_setvalue.sh

Or also without TDB_NOFSYNC=1.
Comment 5 Michael Adam 2012-05-10 08:20:02 UTC
Created attachment 7547 [details]
corresponding script for torturing createkey

this runs concurrent createkey calls in a loop.
Not so easy to trigger a race here as with setvalue.
But the patchset also makes createkey atomic.

Note: Gregor is currently working on a better reg torture tool in C.
Comment 6 Michael Adam 2012-05-10 08:20:34 UTC
==> Karolin for inclusion into v3-6-test
Comment 7 Karolin Seeger 2012-05-10 13:26:33 UTC
Pushed to v3-6-test.
Closing out bug report.

Thanks!