Bug 11693 - smb.conf refactoring broke registry backend use
smb.conf refactoring broke registry backend use
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other
4.3.4
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-25 18:49 UTC by Alexander Bokovoy
Modified: 2016-04-11 12:18 UTC (History)
3 users (show)

See Also:


Attachments
proposed backport patch (2.20 KB, patch)
2016-01-25 18:52 UTC, Alexander Bokovoy
no flags Details
git-am fix for 4.3.next (2.39 KB, patch)
2016-01-26 05:54 UTC, Uri Simchoni
ab: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bokovoy 2016-01-25 18:49:02 UTC
Description of problem:
Samba panics at start.

How reproducible:
[root@ipa root]# smbd -F -S
smbd version 4.3.4 started.
Copyright Andrew Tridgell and the Samba Team 1992-2015
Bad talloc magic value - wrong talloc version used/mixed
PANIC: Bad talloc magic value - wrong talloc version used/mixed
Aborted (core dumped)

Additional info:
FreeIPA configures Samba to use registry backend. With Samba 4.3.4, smb.conf parsing code was refactored but never tested with registry backend. As part of the code that switches smb.conf backend from files to registry, defaults are saved, original context is destroyed and then the rest of smb.conf is read from the registry. Since defaults were allocated using the same original context (Globals.ctx), they already gone but default values in the parm_table[] are still pointing to old memory locations.

When new defaults are saved, old non-NULL values are freed again, causing crashes because there is no talloc context anymore.
Comment 1 Alexander Bokovoy 2016-01-25 18:52:50 UTC
Created attachment 11787 [details]
proposed backport patch

Patch attached.
Comment 2 Uri Simchoni 2016-01-26 05:54:43 UTC
Created attachment 11788 [details]
git-am fix for 4.3.next

Sorry for being nit-picky, attaching the same patch with "cherry-picked from" marker.
Thanks,
Uri
Comment 3 Alexander Bokovoy 2016-01-26 05:55:55 UTC
Comment on attachment 11788 [details]
git-am fix for 4.3.next

Thanks, Uri.
Comment 4 Uri Simchoni 2016-01-26 06:03:16 UTC
Assigning to Karolin for inclusion in next 4.3
Thanks,
Uri
Comment 5 Karolin Seeger 2016-01-26 08:50:08 UTC
(In reply to Uri Simchoni from comment #4)
Pushed to autobuild-v4-3-test.
Comment 6 Karolin Seeger 2016-02-02 10:56:12 UTC
(In reply to Karolin Seeger from comment #5)
Pushed to v4-3-test.
Closing out bug report.

Thanks!