[PATCH] Fix extra_data length in new async winbind idmap code

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Apr 8 23:11:56 MDT 2014


On Wed, Apr 09, 2014 at 01:26:30PM +1200, Andrew Bartlett wrote:
> On Mon, 2014-04-07 at 12:01 +0200, David Disseldorp wrote:
> > On Mon, 07 Apr 2014 14:14:04 +1200, Andrew Bartlett wrote:
> > 
> > > I found this when trying to use winbindd in the AD DC.
> > > 
> > > Please review/push. 
> > 
> > Would have preferred some extra parentheses, but looks good as is:
> > Reviewed-by: David Disseldorp <ddiss at samba.org>
> > 
> > Please add your sign-off and push.
> 
> I've now found the cause of the error, and the patch is attached.
> 
> However, what I would like is a review and comment regarding the degree
> of pointer manipulation in wbc_sids_to_xids().  It is, I agree, very
> efficient code, and is now correct as far as I can see.  However, it
> also feels like the kind of 'just a bit too tricky' code that shouldn't
> be used except in hot paths with little or no other options.
> 
> What do you think?
> 
> https://git.samba.org/samba.git/?p=samba.git;a=blob;f=source4/libcli/wbclient/wbclient.c;h=b5183be121b409d228b25e9aff535e3d6d4c578e;hb=HEAD#l127?
> 
> Thanks,
> 
> Andrew Bartlett
> 
> -- 
> Andrew Bartlett
> http://samba.org/~abartlet/
> Authentication Developer, Samba Team  http://samba.org
> Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba
> 
> 
> 

> >From c7a3754b6abc9dd1dd46c1beb374b104f79f9f94 Mon Sep 17 00:00:00 2001
> From: Andrew Bartlett <abartlet at samba.org>
> Date: Wed, 9 Apr 2014 12:43:54 +1200
> Subject: [PATCH] s4-wbclient: Fix wbc_sids_to_xids to correctly indicate the
>  length of the SID list
> 
> This uses the fact that we know the end of the string in p to avoid
> needing a strlen() call.  Otherwise the winbindd validation that the
> extra_data is terminated may fail, if the un-initiliased memory is not
> zero.
> 
> Andrew Bartlett
> 
> Change-Id: I9b28068e4fbd3754c8d14724af93638d657810dd
> Signed-off-by: Andrew Bartlett <abartlet at samba.org>

Reviewed-by: Volker Lendecke <vl at samba.org>

Thanks and sorry for the bug.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list