Re: net: atm: Spectre v1 fix introduced bug in bcb964012d1b in -stable

From: Gustavo A. R. Silva
Date: Mon May 20 2019 - 12:57:32 EST




On 5/20/19 11:15 AM, Pavel Machek wrote:
> On Mon 2019-05-20 09:15:50, Gustavo A. R. Silva wrote:
>>
>>
>> On 5/20/19 7:40 AM, Pavel Machek wrote:
>>>
>>> In lecd_attach, if arg is < 0, it was treated as 0. Spectre v1 fix
>>> changed that. Bug does not exist in mainline AFAICT.
>>>
>>
>> NACK
>>
>> array_index_nospec() macro returns zero if *arg* is out of bounds.
>
> No, it does not. Take a look:
>
> #define array_index_nospec(index, size)
> ...
> (typeof(_i)) (_i & _mask);
> })
>

Tell me more about that _mask.

Also, don't ignore the backward compatibility; otherwise you
would be forking your own kernel.

--
Gustavo