[OE-core] pseudo: host user contamination

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Tue Mar 27 14:42:03 UTC 2018


Seebs <seebs at seebs.net> writes:

> And so far as I know, it's not actually *possible* to in the general
> case. I really don't think it's safe to try to catch syscall().

I think, something like

----
static void (*orig_syscall)();
long syscall(long number, ...)
{
        switch (number) {
        case __NR_renameat2: return _renameat2_syscall(.......);
        }
        
 	void	*res =__builtin_apply(orig_syscall, __builtin_apply_args(),
				      sizeof(uintmax_t) * 7);

	__builtin_return(res);
}
----

will work to wrap syscall(2).  Params for _renameat2_syscall() can be
extracted by va_args.


Code generated above is very ineffective; perhaps you can create
specialized assembly instructions which just jump into orig_syscall.


Enrico



More information about the Openembedded-core mailing list