Page MenuHomeFreeBSD

rtld-elf: Mark LD_SHOW_AUXV insecure
ClosedPublic

Authored by des on Tue, Dec 2, 2:40 PM.
Tags
None
Referenced Files
F139367085: D54033.diff
Thu, Dec 11, 7:50 AM
Unknown Object (File)
Tue, Dec 9, 10:38 AM
Unknown Object (File)
Mon, Dec 8, 7:17 AM
Unknown Object (File)
Thu, Dec 4, 10:18 PM
Unknown Object (File)
Thu, Dec 4, 8:53 PM
Unknown Object (File)
Wed, Dec 3, 2:33 PM
Unknown Object (File)
Wed, Dec 3, 2:49 AM
Unknown Object (File)
Tue, Dec 2, 11:19 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68997
Build 65880: arc lint + arc unit

Event Timeline

des requested review of this revision.Tue, Dec 2, 2:40 PM

The explanation here being that LD_SHOW_AUX lets an unprivileged user dump (stack?) pointers from a setuid root executable, but the memory map of a privileged process should not be exposed this way.

Indeed, the explicitly stated motivation, at least in the commit message, would be quite useful.

BTW, should LD_BIND_NOW be marked as unsecure, it potentially changes the bindings of the image?

This revision is now accepted and ready to land.Tue, Dec 2, 10:11 PM
In D54033#1234624, @kib wrote:

Indeed, the explicitly stated motivation, at least in the commit message, would be quite useful.

BTW, should LD_BIND_NOW be marked as unsecure, it potentially changes the bindings of the image?

I'm not sure, what happens if we perform lazy binding and the application dlopens a DSO which provides a duplicate symbol? How else can LD_BIND_NOW change the bindings of the image?

BTW, why is LD_BIND_NOT disallowed for sugid binaries? I only found commit 018865f8e8a96.

In D54033#1234624, @kib wrote:

Indeed, the explicitly stated motivation, at least in the commit message, would be quite useful.

BTW, should LD_BIND_NOW be marked as unsecure, it potentially changes the bindings of the image?

I'm not sure, what happens if we perform lazy binding and the application dlopens a DSO which provides a duplicate symbol? How else can LD_BIND_NOW change the bindings of the image?

Yes, this is the scenario. Think about e.g. pam (but I did not looked, if pam modules are opened with RTLD_GLOBAL).

BTW, why is LD_BIND_NOT disallowed for sugid binaries? I only found commit 018865f8e8a96.

Basically for the same reason, the resolution becomes too dynamic, even more so than with the normal lazy bindings. Each call to the PLT-indirected symbol is resolved anew.
Also, this knob changes the ABI, which is might be not what the program expect, so better be safe.

This revision was automatically updated to reflect the committed changes.

This should have been credited as “reported by: Daniel Hodson <daniel@elttam.com>”