Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Thomas Gleixner
On Thu, 15 Feb 2018, Dan Williams wrote: > On Thu, Feb 15, 2018 at 6:05 AM, Rasmus Villemoes > wrote: > > (2) The line "if (id >= ARRAY_SIZE(posix_clocks) || !posix_clocks[id])" > > still seems to allow speculatively accessing posix_clocks[id]. Is that > > ok, and even

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Thomas Gleixner
On Thu, 15 Feb 2018, Dan Williams wrote: > On Thu, Feb 15, 2018 at 6:05 AM, Rasmus Villemoes > wrote: > > (2) The line "if (id >= ARRAY_SIZE(posix_clocks) || !posix_clocks[id])" > > still seems to allow speculatively accessing posix_clocks[id]. Is that > > ok, and even if so, wouldn't it be

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Dan Williams
On Thu, Feb 15, 2018 at 6:05 AM, Rasmus Villemoes wrote: > On 2018-02-15 14:27, Thomas Gleixner wrote: >> The (clock) id argument of clockid_to_kclock() comes straight from user >> space via various syscalls and is used as index into the posix_clocks >> array. >> >>

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Dan Williams
On Thu, Feb 15, 2018 at 6:05 AM, Rasmus Villemoes wrote: > On 2018-02-15 14:27, Thomas Gleixner wrote: >> The (clock) id argument of clockid_to_kclock() comes straight from user >> space via various syscalls and is used as index into the posix_clocks >> array. >> >> Protect it against spectre v1

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Rasmus Villemoes
On 2018-02-15 14:27, Thomas Gleixner wrote: > The (clock) id argument of clockid_to_kclock() comes straight from user > space via various syscalls and is used as index into the posix_clocks > array. > > Protect it against spectre v1 array out of bounds speculation. > > Signed-off-by: Thomas

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Rasmus Villemoes
On 2018-02-15 14:27, Thomas Gleixner wrote: > The (clock) id argument of clockid_to_kclock() comes straight from user > space via various syscalls and is used as index into the posix_clocks > array. > > Protect it against spectre v1 array out of bounds speculation. > > Signed-off-by: Thomas