Bug 4624 - winbind segfaults with idmap_rid
Summary: winbind segfaults with idmap_rid
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: winbind (show other bugs)
Version: 3.0.25
Hardware: Other Linux
: P3 normal
Target Milestone: 3.0.25
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact: Samba QA Contact
URL:
Keywords:
: 4662 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-16 10:54 UTC by Björn Jacke
Modified: 2007-06-16 14:01 UTC (History)
5 users (show)

See Also:


Attachments
winbind log file (5.81 KB, application/octet-stream)
2007-05-16 10:55 UTC, Björn Jacke
no flags Details
gdb backtrace of parent segfault (1.81 KB, text/plain)
2007-05-22 07:39 UTC, Karolin Seeger
no flags Details
winbind log (cut-out) (4.44 KB, text/plain)
2007-05-22 07:45 UTC, Karolin Seeger
no flags Details
idmap_rid segfault fix and bacward compatibility (2.12 KB, patch)
2007-06-09 15:41 UTC, Simo Sorce
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Jacke 2007-05-16 10:54:43 UTC
using idmap_rid with Samba 3.0.25 makes winbind segfault when I do a "wbinfo --user-groups=W2K3AD\\administrator". The idmap parameters are like this:

security = domain
workgroup = W2K3AD
idmap uid=10000-20000
idmap gid=10000-20000
idmap backend = idmap_rid:"W2K3AD=10000-12000,BUILTIN=12001-13000"

very serious looks this from the log file:
[2007/05/16 17:20:18, 0] lib/util.c:talloc_check_name_abort(2977)
  Talloc type mismatch, expected struct winbindd_async_request, got struct getgroups_state
Comment 1 Björn Jacke 2007-05-16 10:55:48 UTC
Created attachment 2696 [details]
winbind log file
Comment 2 Björn Jacke 2007-05-16 11:49:23 UTC
strange. I just retried that with a new samba build *without* stripped binaries, everything else is exactly the same. At least now I cannot reproduce the segfault.
Comment 3 Karolin Seeger 2007-05-22 07:39:22 UTC
Created attachment 2720 [details]
gdb backtrace of parent segfault
Comment 4 Karolin Seeger 2007-05-22 07:45:37 UTC
Created attachment 2721 [details]
winbind log (cut-out)
Comment 5 Karolin Seeger 2007-05-22 07:48:20 UTC
Attachments are created against current SAMBA_3_0_25 branch (same smb.conf as Bjoern has used, reproduced as described above).
Comment 6 Gerald (Jerry) Carter (dead mail address) 2007-05-22 08:08:57 UTC
I'm assuming that we do not have a patch yet?
Comment 7 Karolin Seeger 2007-05-22 08:09:58 UTC
Ok, it seems that idmap_rid does not look at the BUILTIN=x-y parameters at all. Inside idmap_rid_initialize we get

(gdb) p *dom
$3 = {name = 0x8343450 "default domain", default_domain = 1, readonly = 1, private_data = 0x0, methods = 0x82d5ecc,
  initialized = 0, params = 0x83434e8 "BUILTIN=10000-11000,BLA=11001-20000"}

so the parameters are passed down, but I do not see code that would bother to look at dom->params.

Where is that? Am I blind? ;-)))

... this is Volker at Karolins machine btw :-)
Comment 8 Gerald (Jerry) Carter (dead mail address) 2007-05-22 08:38:55 UTC
Karolin, You are probably right and I believe that the idmap_rid.c may 
be suffering from bit rot.  I'll take a look at this.

Couple of comments:

(a) The BUILTIN and MACHINE domain should always be handled by 
    idmap_passdb and not generic idmap plugins.
(b) The correct way to get multi-domain support from idmap_rid 
    will be to define a list of idmap domains and configure the
    rid backend for each domain.
(c) Multi-domain support prior to 3.0.25 for idmap_rid always required
    a #define to enable the experiemental feature.

Comment 9 Björn Jacke 2007-05-22 08:45:45 UTC
even if multiple domain support had to be enabled by a #define I would consider it to have been supported as smb.conf(5) (checked 3.0.2[34]) said:

  Example: idmap backend = rid:"BUILTIN=1000-1999,DOMNAME=2000-100000000"

Comment 10 Gerald (Jerry) Carter (dead mail address) 2007-05-22 08:59:14 UTC
(In reply to comment #9)
> even if multiple domain support had to be enabled by a #define I would consider
> it to have been supported as smb.conf(5) (checked 3.0.2[34]) said:
> 
>   Example: idmap backend = rid:"BUILTIN=1000-1999,DOMNAME=2000-100000000"

You'll have to whine at Guenther about that.  My position has always
been that the multi-domain feature was experiemental and hence not enabled
by default with "./configure && make && make install".

Moving forward, I'll maintain this code.  Patches forthcoming but probably
for 3.0.25b.

Comment 11 Karolin Seeger 2007-06-04 08:02:33 UTC
We have several customers with the old idmap backend config:

idmap uid=10000-20000
idmap gid=10000-20000
idmap backend = idmap_rid:"W2K3AD=10000-12000"

(Only one domain!)

This config does not work in Samba 3.0.25 and 3.0.25a, because winbindd segfaults again.

What about backward compatibility? Should this setup still work or is only the new configuration supported?
Comment 12 Simo Sorce 2007-06-09 15:24:12 UTC
(In reply to comment #11)
> We have several customers with the old idmap backend config:
> 
> idmap uid=10000-20000
> idmap gid=10000-20000
> idmap backend = idmap_rid:"W2K3AD=10000-12000"
> 
> (Only one domain!)
> 
> This config does not work in Samba 3.0.25 and 3.0.25a, because winbindd
> segfaults again.
> 
> What about backward compatibility? Should this setup still work or is only the
> new configuration supported?

In >= 3.0.25 only the "idmap domains" configuration options can help you out with idmap rid.
Only the non-multi-domain default behavior of idmap_rid will be supported with idmap backend = rid
Comment 13 Simo Sorce 2007-06-09 15:26:26 UTC
*** Bug 4662 has been marked as a duplicate of this bug. ***
Comment 14 Simo Sorce 2007-06-09 15:41:17 UTC
Created attachment 2746 [details]
idmap_rid segfault fix and bacward compatibility

This patch (a new fixed version) was attached to #4662 which is basically the same bug discussed here.

This patch should fix the segfault problem and handle correctly the only backward configuration we decided to handle. (non multi-domain with idmap backend = rid.)

Multi domain is available with idmap domains, and BUILTIN is handle by idmap_passdb and group mapping.

Please let me know if this patch is ok for you and I'll commit it to all branches.
Comment 15 Simo Sorce 2007-06-16 14:01:11 UTC
Committed as r23525
To me this closes the bug, reopen it if there is still some probelm.