RFC: Call external functions without PLT

23 views
Skip to first unread message

H.J. Lu

unread,
Jun 24, 2016, 7:24:45 AM6/24/16
to IA32 System V Application Binary Interface
Procedure Linkage Table (PLT) is used to access external functions
defined in shared object and support

1. Lazy symbol resolution The function address is resolved only when
it is called the first time at run-time.
2. Canonical function address The PLT entry of the external function
is used as its address, aka function pointer.

The first instruction in the PLT entry is an indirect branch via the Global
Offset Table (GOT) entry of the external function, which is set up in such
a way that it will be updated to the address of the function body the first
time when the function is called. Since the GOT entry is writable, any
address may be written to it at run-time, which is a potential security risk.

I am proposing alternate code sequences to call external functions
without going through PLT. My proposal is on hjl/x86/secure branch at

https://github.com/hjl-tools/x86-psABI

and PDF file is at

https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-secure.pdf

Any comments.

Thanks.

--
H.J.
Reply all
Reply to author
Forward
0 new messages