Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/librumphijack



On Tue, Feb 08, 2011 at 03:34:54PM -0500, Christos Zoulas wrote:
> Still the problem remains, how do we stack the calls to insert the ssp
> check at the top level, without resorting to rtld tricks?

Let me try to summarize the situation to make sure I get it right:

The fortification code wants to provide an inline function "read" that
calls the real "read" after doing the argument checks.

rumphijack wants to override the "read" symbol, apply some magic and
call "_sys_read" for the real system call.

To get the layering correct, we could make the fortification code define
another prototype and use double rename, e.g.

ssize_t __real_read(int __fd, ...) __RENAME(read);

__ssp_inline ssize_t read(int __fd, ...) __RENAME(__ssp_read);

__sso_inline ssize_t read(int __fd, ...) {
        __ssp_check(__buf, __lean, bos);
        return __real_read(__fd, ...);
}

Joerg


Home | Main Index | Thread Index | Old Index