logging _rtld errors

Kostik Belousov kostikbel at gmail.com
Tue Dec 20 09:58:25 UTC 2011


On Tue, Dec 20, 2011 at 09:36:28AM +1100, Peter Jeremy wrote:
> On 2011-Dec-19 22:01:04 +0200, Kostik Belousov <kostikbel at gmail.com> wrote:
> >On Mon, Dec 19, 2011 at 11:54:46AM -0800, Xin LI wrote:
> >> It doesn't seem to me that this proposed change would do something
> >> with security?
> 
> rtld is a fairly critical part of FreeBSD infrastructure and there
> have been several instances where rtld changes have resulted in
> security vulnerabilities.
[Removed].

> 
> >I also think that UTRACE part is not bad, but will object against the
> >LD_PRINT_ERROR part.
> 
> Could you please explain your objections to the LD_PRINT_ERROR part as
> I don't see an immediate problem with them.
The rtld is the low level facility, that shall silently do its work.
It is the same kind of runtime glue as libc or libthr. It shall return
errors to the caller.

We do not change libc by adding knob to print errors if some libc function
failed, so why shall we do this for rtld ? Adding utrace would ease
the introspection (which in fact can be already deduced from the other
ktrace output, but I agree that this require some knowledge of rtld
internals, thus explicit error tracing make it more accessible).

Also please note that rtld already has debug mode that is exactly designed
for debugging dynamic linking problems.

The fact that rtld returns string representation of the error instead of
error codes like errno is mostly a mistake.
> 
> > FWIW, it should use rtld_printf() instead of printf(),
> >but this is moot point.
> 
> Accepted.
> 
> On 2011-Dec-19 21:02:49 +0100, Cl?ment Lecigne <clemun at gmail.com> wrote:
> >Dont know but the ld_printerror != '\0' in the patch should be
> >*ld_printerror != '\0', no?
> 
> Oops, my mistake.  Yes, there is a missing '*'.
> 
> -- 
> Peter Jeremy


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-security/attachments/20111220/99e87940/attachment.pgp


More information about the freebsd-security mailing list