Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-23 Thread Gustavo A. R. Silva
On 12/23/18 5:58 PM, David Miller wrote: From: Alexei Starovoitov Date: Sat, 22 Dec 2018 22:00:00 -0800 On Sat, Dec 22, 2018 at 11:03:31PM -0600, Gustavo A. R. Silva wrote: I took another look at the following patches: "net: core: Fix Spectre v1 vulnerability" "nfc: af_nfc: Fix Spectre v1

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-23 Thread David Miller
From: Alexei Starovoitov Date: Sat, 22 Dec 2018 22:00:00 -0800 > On Sat, Dec 22, 2018 at 11:03:31PM -0600, Gustavo A. R. Silva wrote: >> > I took another look at the following patches: >> > "net: core: Fix Spectre v1 vulnerability" >> > "nfc: af_nfc: Fix Spectre v1 vulnerability" >> > "can:

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Alexei Starovoitov
On Sat, Dec 22, 2018 at 11:03:31PM -0600, Gustavo A. R. Silva wrote: > Alexei, > > On 12/22/18 10:12 PM, Alexei Starovoitov wrote: > > On Sat, Dec 22, 2018 at 09:37:02PM -0600, Gustavo A. R. Silva wrote: > > > > > > Can't we have the case in which the code can be "trained" to read > > >

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Gustavo A. R. Silva
Alexei, On 12/22/18 10:12 PM, Alexei Starovoitov wrote: On Sat, Dec 22, 2018 at 09:37:02PM -0600, Gustavo A. R. Silva wrote: Can't we have the case in which the code can be "trained" to read perfectly valid values for prog->len for quite a while, making the microcode come into place and

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Alexei Starovoitov
On Sat, Dec 22, 2018 at 09:37:02PM -0600, Gustavo A. R. Silva wrote: > > Can't we have the case in which the code can be "trained" to read > perfectly valid values for prog->len for quite a while, making the > microcode come into place and speculate about: > > 1013 if (flen == 0 || flen

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Gustavo A. R. Silva
On 12/22/18 9:00 PM, Alexei Starovoitov wrote: On Sat, Dec 22, 2018 at 08:53:40PM -0600, Gustavo A. R. Silva wrote: Hi, On 12/22/18 8:40 PM, David Miller wrote: From: Alexei Starovoitov Date: Sat, 22 Dec 2018 15:59:54 -0800 On Sat, Dec 22, 2018 at 03:07:22PM -0800, David Miller wrote:

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Gustavo A. R. Silva
Alexei, On 12/22/18 9:37 PM, Gustavo A. R. Silva wrote: On 12/22/18 9:00 PM, Alexei Starovoitov wrote: On Sat, Dec 22, 2018 at 08:53:40PM -0600, Gustavo A. R. Silva wrote: Hi, On 12/22/18 8:40 PM, David Miller wrote: From: Alexei Starovoitov Date: Sat, 22 Dec 2018 15:59:54 -0800 On

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Alexei Starovoitov
On Sat, Dec 22, 2018 at 08:53:40PM -0600, Gustavo A. R. Silva wrote: > Hi, > > On 12/22/18 8:40 PM, David Miller wrote: > > From: Alexei Starovoitov > > Date: Sat, 22 Dec 2018 15:59:54 -0800 > > > > > On Sat, Dec 22, 2018 at 03:07:22PM -0800, David Miller wrote: > > > > From: "Gustavo A. R.

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Gustavo A. R. Silva
Hi, On 12/22/18 8:40 PM, David Miller wrote: From: Alexei Starovoitov Date: Sat, 22 Dec 2018 15:59:54 -0800 On Sat, Dec 22, 2018 at 03:07:22PM -0800, David Miller wrote: From: "Gustavo A. R. Silva" Date: Fri, 21 Dec 2018 14:49:01 -0600 flen is indirectly controlled by user-space, hence

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread David Miller
From: Alexei Starovoitov Date: Sat, 22 Dec 2018 15:59:54 -0800 > On Sat, Dec 22, 2018 at 03:07:22PM -0800, David Miller wrote: >> From: "Gustavo A. R. Silva" >> Date: Fri, 21 Dec 2018 14:49:01 -0600 >> >> > flen is indirectly controlled by user-space, hence leading to >> > a potential

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread Alexei Starovoitov
On Sat, Dec 22, 2018 at 03:07:22PM -0800, David Miller wrote: > From: "Gustavo A. R. Silva" > Date: Fri, 21 Dec 2018 14:49:01 -0600 > > > flen is indirectly controlled by user-space, hence leading to > > a potential exploitation of the Spectre variant 1 vulnerability. > > > > This issue was

Re: [PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-22 Thread David Miller
From: "Gustavo A. R. Silva" Date: Fri, 21 Dec 2018 14:49:01 -0600 > flen is indirectly controlled by user-space, hence leading to > a potential exploitation of the Spectre variant 1 vulnerability. > > This issue was detected with the help of Smatch: > > net/core/filter.c:1101

[PATCH] net: core: Fix Spectre v1 vulnerability

2018-12-21 Thread Gustavo A. R. Silva
flen is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: net/core/filter.c:1101 bpf_check_classic() warn: potential spectre issue 'filter' [w] Fix this by sanitizing flen