returning values on talloc_tos() (was Re: [PATCH][WIP] Make vfs_acl_xattr use hash of the posix ACL)

Andrew Bartlett abartlet at samba.org
Wed Oct 10 21:32:52 MDT 2012


On Wed, 2012-10-10 at 20:22 -0700, Jeremy Allison wrote:
> On Thu, Oct 11, 2012 at 11:27:56AM +1100, Andrew Bartlett wrote:
> > 
> > Given that we memory we specifically return is allocated on the supplied
> > context, what assumptions are you thinking of?
> 
> The kind of assumptions that lead me to commit this :
> 
> 615951e4e77353547d91fb217b1861877540bde7
> 
> which might have ended up crashing the server
> given the right RPC call.

I think we are both chasing the same issue, just from different
ends.  :-)

Indeed, I actually changed that code to pass sd_buf as the memory
context for the returned SD, eliminating the need to talloc_move(). 

> > I'll find and fix these two (already removed another one of those) - the
> > memory context is specified - as frame, the last parameter - it doesn't
> > need the talloc_steal!
> 
> Oh cool, I missed that ! Thanks :-).
> 
> > As I think I've addressed all the issues raised by you and Simo, I
> > propose to autobuild everything except the vfs_acl_common changes soon.
> > (I still need to add fix and add tests for actual use of the new hash
> > code).
> > 
> > https://git.samba.org/abartlet/samba.git/?p=abartlet/samba.git/.git;a=shortlog;h=refs/heads/fix-acls2
> 
> Won't have time to read that until tomorrow (late here) but
> as I said there were no show-stoppers for me.

Thanks.  It's been great to be able to tidy up the memory handling here.
With these changes, all returned objects from the VFS are on talloc (as
far as I can tell from reading vfs.h), and all execpt for the fsp from
create_file() are on a supplied talloc memory context. 

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list