Bug 13195 - g_lock conflict detection broken when processing stale entries.
g_lock conflict detection broken when processing stale entries.
Status: REOPENED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other
4.7.3
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-20 07:17 UTC by Stefan Metzmacher
Modified: 2018-08-14 12:53 UTC (History)
4 users (show)

See Also:


Attachments
Backport for v4-7-test (1.58 KB, patch)
2017-12-21 21:08 UTC, Stefan Metzmacher
no flags Details
Backport for v4-6-test (1.69 KB, patch)
2017-12-21 21:09 UTC, Stefan Metzmacher
no flags Details
Backport for v4-7-test (1.58 KB, patch)
2017-12-21 21:18 UTC, Stefan Metzmacher
jra: review+
vl: review+
Details
Backport for v4-6-test (1.69 KB, patch)
2017-12-21 21:18 UTC, Stefan Metzmacher
jra: review+
vl: review+
Details
Patch for 4.7 (8.22 KB, patch)
2018-08-14 12:53 UTC, Volker Lendecke
vl: review? (metze)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Metzmacher 2017-12-20 07:17:11 UTC
g_lock_trylock() always increments the counter 'i',
even after cleaning a stale entry at position 'i',
which means it will skip checking for a conflict
against the new entry at position 'i'.

As result more than one process could assume it holds an exclusive
lock.
Comment 1 Stefan Metzmacher 2017-12-21 21:08:43 UTC
Created attachment 13881 [details]
Backport for v4-7-test
Comment 2 Stefan Metzmacher 2017-12-21 21:09:19 UTC
Created attachment 13882 [details]
Backport for v4-6-test
Comment 3 Stefan Metzmacher 2017-12-21 21:18:03 UTC
Created attachment 13883 [details]
Backport for v4-7-test

Compiles now...
Comment 4 Stefan Metzmacher 2017-12-21 21:18:44 UTC
Created attachment 13884 [details]
Backport for v4-6-test
Comment 5 Jeremy Allison 2017-12-21 21:32:54 UTC
Re-assigning to Karolin for inclusion in 4.7.next, 4.6.next.
Comment 6 Karolin Seeger 2017-12-22 17:11:00 UTC
(In reply to Jeremy Allison from comment #5)
Pushed to v4-7-test and autobuild-v4-6-test.
Comment 7 Karolin Seeger 2017-12-23 20:14:01 UTC
Pushed to both branches.
Closing out bug report.

Thanks!
Comment 8 Volker Lendecke 2018-08-14 12:53:10 UTC
Created attachment 14421 [details]
Patch for 4.7

4.7 is not fully right yet, upgrades are not covered properly. 4.8 and 4.9 are not affected.