Bug 10130 - samba crashes on opening Terminal Services Profile tab (userParameters field)
Summary: samba crashes on opening Terminal Services Profile tab (userParameters field)
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.1.0rc2
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Blocks: 8077
  Show dependency treegraph
Reported: 2013-09-07 17:34 UTC by Gints Neimanis
Modified: 2016-07-15 14:47 UTC (History)
3 users (show)

See Also:

excerpt from log.samba (102.82 KB, application/octet-stream)
2013-09-07 20:47 UTC, Gints Neimanis
no flags Details
Patch for ldb_val to lsa_BinaryString conversation (2.34 KB, patch)
2014-05-27 19:44 UTC, Stefan Gohmann
no flags Details
Temporary patches for v4-1-test (28.08 KB, patch)
2014-07-08 17:38 UTC, Stefan Metzmacher
abartlet: review+
Patches for v4-1-test (28.54 KB, patch)
2014-07-09 15:03 UTC, Stefan Metzmacher
metze: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Gints Neimanis 2013-09-07 17:34:54 UTC
I have migrated WINNT 4 Domain ->  Win2000 AD and recently ->  Windows 2003 AD -> Samba 4.0.6 -> Samba 4.1.rc2.
Unfortunately Samba regularly crashes, and I'm trying to find reasons.

Steps to reproduce:
One case, when Samba always crashed was:
* open ADUC from Windows 2003 Server
* connect to Samba4 DC
* open one known user "Properties"
* open "Terminal Services Profile"
* Then I got something like "remote RPC unavailable" (don't remember exactly) and Samba4 crashes with error mesage:

*** glibc detected *** /usr/local/samba/sbin/samba: corrupted double-linked list: 0x00007f475de505f0 ***

After that I removed completely the userParameters field with "ldbedit" for this user, restarted Samba and now I can open "Terminal services Profile" tab for this user without any trouble.

The userParameters field, which caused the  crash, for this user was (acquired with ldbsearch -H sam.ldb userParameters): 


Build Date & Platform:
Version 4.1.0rc2
cat /etc/lsb-release 
Comment 1 Simo Sorce 2013-09-07 18:40:32 UTC
If you can get us a stacktrace (normally samba prints one in the logs when it crashes), then it should be relatively simple to find where we are corrupting glibc's stack.
Comment 2 Gints Neimanis 2013-09-07 20:47:04 UTC
Created attachment 9199 [details]
excerpt from log.samba
Comment 3 Gints Neimanis 2013-10-22 06:13:49 UTC
After manually removing all userParameters entries, samba process does'nt crashes anymore.

Closed bug because is will be hard to reproduce initial Windows DC environment to see what values exactly contains this attribute.
Comment 4 Andrew Bartlett 2013-10-22 19:44:02 UTC
We do want to fix this and are working to improve handling in this area, by treating this as binary, not as a string.  We also want to find the cause of the crash, as it implies other non-string data could cause issues as well.
Comment 5 Stefan Gohmann 2014-05-27 19:44:06 UTC
Created attachment 9983 [details]
Patch for ldb_val to lsa_BinaryString conversation

Does the attached patch fix this issue?
Comment 6 Stefan Metzmacher 2014-07-08 17:38:50 UTC
Created attachment 10091 [details]
Temporary patches for v4-1-test

Once I got the master for through autobuild,
I can upload the patches with cherry-pick -x information,
but the content will be the same so this can be reviewed now.
Comment 7 Andrew Bartlett 2014-07-09 04:40:59 UTC
Comment on attachment 10091 [details]
Temporary patches for v4-1-test

(make sure to grab from my patches replied to the list, with the userParameter -> userParameters typo fix)
Comment 8 Stefan Metzmacher 2014-07-09 15:03:23 UTC
Created attachment 10096 [details]
Patches for v4-1-test

The same as the temporary patches with cherry-pick information
Comment 9 Karolin Seeger 2014-07-13 18:06:24 UTC
(In reply to comment #8)
> Created attachment 10096 [details]
> Patches for v4-1-test
> The same as the temporary patches with cherry-pick information

Pushed to autobuild-v4-1-test.
Comment 10 Karolin Seeger 2014-07-17 18:53:10 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Created attachment 10096 [details] [details]
> > Patches for v4-1-test
> > 
> > The same as the temporary patches with cherry-pick information
> Pushed to autobuild-v4-1-test.

Pushed to v4-1-test.
Closing out bug report.

Comment 11 trenta 2016-07-15 14:47:00 UTC
Hi Stefan,

We are tying to migrate samba 3 to samba 4 AD (4.4.5) and we detected that with latest version of samba 4 error persist, trying to modify userParameters attribute in ldap  with

new LDAPModification(LDAPModification.REPLACE, new LDAPAttribute("userParameters", userEntry.getAttribute("userParameters").getByteValue()))

we receive this error:
LDAPException: Violación Del Constreñimiento (19) Violación Del Constreñimiento
LDAPException: Server Message: 0000202F: samldb: setting userParameters is not supported over LDAP, see https://bugzilla.samba.org/show_bug.cgi?id=8077 at ../source4/dsdb/samdb/ldb_modules/samldb.c:3104

We need to update this attribute because with samba 3 we have data and we need to migrate to keep same features.

Can you solve  for samba 4.4?