Bug 10130 - samba crashes on opening Terminal Services Profile tab (userParameters field)
Summary: samba crashes on opening Terminal Services Profile tab (userParameters field)
Status: RESOLVED FIXED
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
URL:
Keywords:
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:


Attachments
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+
Details
Patches for v4-1-test (28.54 KB, patch)
2014-07-09 15:03 UTC, Stefan Metzmacher
metze: review+
Details

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
Overview: 
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): 

userParameters:: ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
 CAgUBAaCAFDdHhDZmdQcmVzZW5045S15pSx5oiw44GiGAgBQ3R4Q2ZnRmxhZ3Mx44Cw44Gm46Cy44
 C5FggBQ3R4Q2FsbGJhY2vjgLDjgLDjgLDjgLASCAFDdHhTaGFkb3fjhLDjgLDjgLDjgLAoCAFDdHh
 NYXhDb25uZWN0aW9uVGltZeOAsOOAsOOAsOOAsC4IAUN0eE1heERpc2Nvbm5lY3Rpb25UaW1l44Cw
 44Cw44Cw44CwHAgBQ3R4TWF4SWRsZVRpbWXjgLDjgLDjgLDjgLAiCAFDdHhLZXlib2FyZExheW91d
 OOAsOOAsOOAsOOAsCoCAUN0eE1pbkVuY3J5cHRpb25MZXZlbOOEsCACAUN0eFdvcmtEaXJlY3Rvcn
 njgLAgAgFDdHhOV0xvZ29uU2VydmVy44CwGAIBQ3R4V0ZIb21lRGly44CwIgIBQ3R4V0ZIb21lRGl
 yRHJpdmXjgLAgNAFDdHhXRlByb2ZpbGVQYXRo5oy15oy145y346S25pS245C345S244i344yz5oy1
 44i35pi244S25pC246S25pS245y25oy144S245y25pS245S244y345S245C244CwIgIBQ3R4SW5pd
 GlhbFByb2dyYW3jgLAiAgFDdHhDYWxsYmFja051bWJlcuOAsOOAsOOAsOOctOaEs+OAsExvZ29uU2
 VydmVy44Cw44Cw45y05oSz44Cw

Build Date & Platform:
Version 4.1.0rc2
cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.3 LTS"
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.

Thanks!
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?

thanks