Bug 9037 - Name clash in MD5 cause the "net ads join" fails on T4 (sun4v) systems on Solaris 10.
Summary: Name clash in MD5 cause the "net ads join" fails on T4 (sun4v) systems on Sol...
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.6.7
Hardware: Sparc Solaris
: P5 regression
Target Milestone: ---
Assignee: Stefan Metzmacher
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 9086 9418
  Show dependency treegraph
 
Reported: 2012-07-13 01:31 UTC by Jura Sasek
Modified: 2020-01-04 01:22 UTC (History)
4 users (show)

See Also:


Attachments
rfc1321 (Solaris libmd5.so) patch against the samba-3.6.6 (12.90 KB, patch)
2012-07-13 01:31 UTC, Jura Sasek
no flags Details
rfc1321 (Solaris libmd5.so) patch against the git master (16.04 KB, patch)
2012-07-30 11:06 UTC, Jura Sasek
no flags Details
This seems to fix the build on FreeBSD. (1.42 KB, patch)
2012-08-16 20:57 UTC, Volker Lendecke
bjacke: review+
Details
possible fix for the netbsd and openbsd cases (1.02 KB, patch)
2012-08-24 19:17 UTC, Björn Jacke
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jura Sasek 2012-07-13 01:31:01 UTC
Created attachment 7699 [details]
rfc1321 (Solaris libmd5.so) patch against the samba-3.6.6

There is a name clash of calls MD5Init(), MD5Update() and MD5Final() in samba-3.6.x/lib/crypto/md5.h with libmd5.so on Solaris 9, 10 and 11.

On Solaris 10 running on T4 system it will even fail the "net ads join" command.

On the other releases it should also represent the performance drop when the generic routines are called from samba's:/lib/crypto/ instead of native ones. Solaris optimizes various crypto algos for amd64, sun4u and especially for sun4v (T1,T2 using the MAU crypto engine) and definitively T4 directly using the crypto instruction set.

Dynamic linker on Solaris does not have resources to avoid the "call-back" of Samba function when the function of the same name is called in the Solaris native library. It can cause also the strange behavior of Samba.

I am attaching a patch against the samba-3.6.6. Patch to source upstream will need further effort to merge it with the similar issue contributed by Matthieu Patou in:
http://gitweb.samba.org/?p=samba.git;a=commitdiff;h=b68f72c7f58c05870100d0d993c9baf0fa80a891
Comment 1 Volker Lendecke 2012-07-13 03:25:31 UTC
This looks good to me. For example FreeBSD has a /usr/include/sys/md5.h and corresponding lib that appears to do the same. Of course OpenSSL offers similar functionality, but I am not sure we can link to that license-wise.

Volker
Comment 2 Jeremy Allison 2012-07-13 21:16:12 UTC
Looks good to me also. Jiri - can you create a patch for master also ?

Thanks !

Jeremy.
Comment 3 Jeremy Allison 2012-07-13 21:40:35 UTC
Re-assigning to Karolin for inclusion in 3.6.next.
Jeremy.
Comment 4 Jura Sasek 2012-07-16 12:27:04 UTC
(In reply to comment #2)
> Looks good to me also. Jiri - can you create a patch for master also ?
> 
> Thanks !
> 
> Jeremy.

Yes. ...but please later of this week. It is too fast for lazy Jiri  :-)
Comment 5 Jeremy Allison 2012-07-16 19:39:36 UTC
No problem - so long as we have it in master sometime. Won't do to have 3.6.x ahead of 4.0.0 :-).

Thanks !

Jeremy.
Comment 6 Karolin Seeger 2012-07-24 18:59:46 UTC
Pushed to v3-6-test.

Still an issue in master.
Comment 7 Karolin Seeger 2012-07-29 18:54:03 UTC
(In reply to comment #0)
> I am attaching a patch against the samba-3.6.6. Patch to source upstream will
> need further effort to merge it with the similar issue contributed by Matthieu
> Patou in:
> http://gitweb.samba.org/?p=samba.git;a=commitdiff;h=b68f72c7f58c05870100d0d993c9baf0fa80a891

This patch has been pushed to the release branch. If other patches are needed as well, please provide them until tomorrow, because the branch will be frozen then.

Thanks!

Karolin
Comment 8 Jura Sasek 2012-07-30 11:06:43 UTC
Created attachment 7728 [details]
rfc1321 (Solaris libmd5.so) patch against the git master
Comment 9 Jura Sasek 2012-07-30 11:14:07 UTC
> This patch has been pushed to the release branch. If other patches are needed
> as well, please provide them until tomorrow, because the branch will be frozen
> then.
> 
> Thanks!
> 
> Karolin

Thanks for notify. I have tested. Builds fine on Solaris 11 where libmd5.so name clash is off.

Jeremy,

I have prepared the patch against git master. I apologize for delay. Could it be possible to test it on the build-farm  ...focused on BSD and MacOS builds ...which can be affected.

Thanks
Comment 10 Karolin Seeger 2012-07-30 17:01:38 UTC
(In reply to comment #9)
> > This patch has been pushed to the release branch. If other patches are needed
> > as well, please provide them until tomorrow, because the branch will be frozen
> > then.
> > 
> > Thanks!
> > 
> > Karolin
> 
> Thanks for notify. I have tested. Builds fine on Solaris 11 where libmd5.so
> name clash is off.
> 
> Jeremy,
> 
> I have prepared the patch against git master. I apologize for delay. Could it
> be possible to test it on the build-farm  ...focused on BSD and MacOS builds
> ...which can be affected.
> 
> Thanks

I am afraid that it's too late for Samba 3.6.7 then.
The first patch will be included, but the second one needs the review flag first.
Comment 11 Björn Jacke 2012-08-16 10:16:39 UTC
as this caused a regression on all the *BSD platforms we should revert that patch in the stable release branch I think. See bug #9086 for example...
Comment 12 Volker Lendecke 2012-08-16 15:45:55 UTC
Just compiled 3.6.7 on FreeBSD9, and that went through. Haven't digged deeply enough though. But it's not *all* BSDs that fail. openbsd build runs right now.
Comment 13 Volker Lendecke 2012-08-16 15:52:06 UTC
(In reply to comment #12)
> Just compiled 3.6.7 on FreeBSD9, and that went through. Haven't digged deeply
> enough though. But it's not *all* BSDs that fail. openbsd build runs right now.

Ignore that. Built in the wrong branch. FreeBSD fails as well.
Comment 14 Jura Sasek 2012-08-16 17:23:01 UTC
(In reply to comment #11)
> as this caused a regression on all the *BSD platforms we should revert that
> patch in the stable release branch I think. See bug #9086 for example...

Collision(*) with BSDs is fixed in patch against the "master"

(*)- mentioned in "Description"
Comment 15 Volker Lendecke 2012-08-16 20:57:36 UTC
Created attachment 7785 [details]
This seems to fix the build on FreeBSD.

Can someone test this on Solaris?
Comment 16 Björn Jacke 2012-08-17 10:05:16 UTC
Comment on attachment 7785 [details]
This seems to fix the build on FreeBSD.

works on our Solaris 8 buildfarm machine. Karo, can you please get this to the 3.6 branch? We should also especially  watch the *BSD and Solaris buildfarm builds after that.
Comment 17 Karolin Seeger 2012-08-23 18:30:19 UTC
(In reply to comment #16)
> Comment on attachment 7785 [details]
> This seems to fix the build on FreeBSD.
> 
> works on our Solaris 8 buildfarm machine. Karo, can you please get this to the
> 3.6 branch? We should also especially  watch the *BSD and Solaris buildfarm
> builds after that.

Pushed to v3-6-test.
Please clarify if the other patch still needs to be reverted.

Thanks!
Comment 18 Björn Jacke 2012-08-24 05:42:29 UTC
i think no, the revert was just suggested because it broke the BSD builds, which Volkers Patch now fixed.
Comment 19 Brad Smith 2012-08-24 17:24:53 UTC
v3-6-test is still broken on OpenBSD/NetBSD.

Compiling ../lib/crypto/md5.c
../lib/crypto/md5.c:26: error: conflicting types for 'MD5Transform'
/usr/include/md5.h:39: error: previous declaration of 'MD5Transform' was here

OpenBSD/NetBSD have the MD5 implementation within libc instead of libmd5/libmd.
Comment 20 Björn Jacke 2012-08-24 19:15:31 UTC
please test the following patch
Comment 21 Björn Jacke 2012-08-24 19:17:37 UTC
Created attachment 7819 [details]
possible fix for the netbsd and openbsd cases
Comment 22 Brad Smith 2012-08-24 20:59:57 UTC
That patch fixes the build.
Comment 23 Volker Lendecke 2012-08-26 10:20:20 UTC
Comment on attachment 7819 [details]
possible fix for the netbsd and openbsd cases

Compiled on Linux, OpenBSD and FreeBSD
Comment 24 Björn Jacke 2012-08-27 10:51:00 UTC
Karo: the "possible fix for the netbsd and openbsd cases" needs to get into the next 3.6 release to fix the regeression that was introduced with the previous release.
Comment 25 Karolin Seeger 2012-08-28 07:26:14 UTC
Pushed to v3-6-test.
Closing out bug report.

Thanks!
Comment 26 Michael Letzgus-Koppmann 2012-10-25 20:50:24 UTC
Please watch this:

https://bugzilla.samba.org/show_bug.cgi?id=9330
Comment 27 Stefan Metzmacher 2012-11-13 15:07:52 UTC
Why are this patches only included in 3.6 and not master?
Comment 28 Björn Jacke 2014-06-13 17:53:44 UTC
do we have any MD5 checks in the waf build? In the old autobuild we tested for MD5Update but I cannot find anything like that in any wscript files.
Comment 29 Andreas Schneider 2014-10-28 11:04:37 UTC
Ping!
Comment 30 Karolin Seeger 2014-11-27 10:51:39 UTC
Is this a showstopper for 4.2.0?
Comment 31 Stefan Metzmacher 2014-11-29 10:13:25 UTC
Not a 4.2.0 blocker, remember for 4.3...
Comment 32 Björn Jacke 2020-01-04 01:22:02 UTC
closing this because starting with Samba 4.11 Samba uses gnutls for all the crypto.

Jiri: Did Oracle already provide code for for the Sparc's hw acceleration for gnutls? Otherwise there would be a good reasone to do that now :)