Re: [PATCH] mips: vdso: conditionalize 32-bit time functions on COMPAT_32BIT_TIME

From: Jason A. Donenfeld
Date: Mon Dec 30 2019 - 10:10:18 EST


On Mon, Dec 30, 2019 at 3:37 PM Jason A. Donenfeld <Jason@xxxxxxxxx> wrote:
>
> On Mon, Dec 30, 2019 at 1:34 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> >
> > - Why does it crash in the first place rather than returning -ENOSYS?
>
> There's a bit of speculation about this in the original thread that
> prompted this patch (you're CC'd).

The following will provoke the crash:

__attribute__((noinline)) void somefunc(void) { }

int __clock_gettime(clockid_t clk, struct timespec *ts)
{
((int (*)(clockid_t, struct timespec *))vdso_func)(clk, ts);
somefunc();
return 88;
}

It seems like the VDSO is doing something to the stack.