[SSSD] On talloc_new(NULL) (ab)use in SSSD

Jakub Hrozek jhrozek at redhat.com
Mon Jan 7 19:19:49 UTC 2013


On Mon, Jan 07, 2013 at 02:09:02PM -0500, Stephen Gallagher wrote:
> >One concern I expressed to Simo on IRC is that we'd have to be more
> >careful with long-lived requests such as resolving deep nested group
> >memberships, otherwise the parent context will grow out of control.
> >
> >If SSS_FREE_MEM_CTX was used rigorously, then it would be much less of
> >an issue. Maybe we could write a small GCC plugin to issue a warning for
> >functions that call SSS_MEM_CTX but not SSS_FREE_MEM_CTX.
> 
> I'm not really familiar with GCC plugins, but can we model that to
> detect whether a branch decision could allow it to exit without
> calling SSS_FREE_MEM_CTX? I think some of the static analysis tools
> like Coverity can do this, but I don't know if GCC itself can.

There is a plugin that tracks reference counts in Python plugins written
in C:
https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html#reference-count-checking

I haven't seen its source code so I can't comment on how easy/hard it
is, but it seems doable.



More information about the sssd-devel mailing list