Bug 13195 - g_lock conflict detection broken when processing stale entries.
Summary: g_lock conflict detection broken when processing stale entries.
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.7.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-20 07:17 UTC by Stefan Metzmacher
Modified: 2018-08-24 09:48 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
metze: review+
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.
Comment 9 Stefan Metzmacher 2018-08-16 12:35:07 UTC
Comment on attachment 14421 [details]
Patch for 4.7

Karolin, please add my review to patches 2 and 3.
Comment 10 Karolin Seeger 2018-08-23 07:54:55 UTC
(In reply to Stefan Metzmacher from comment #9)
Pushed to autobuild-v4-7-test after adding (reviewed-by tags).
Comment 11 Karolin Seeger 2018-08-24 09:48:26 UTC
(In reply to Karolin Seeger from comment #10)
Pushed to v4-7-test.
Closing out bug report.

Thanks!