lkml.org 
[lkml]   [2019]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 4.14 38/53] IB/hfi1: Fix Spectre v1 vulnerability
    From
    Date
    Hi Greg,

    Can you please add these other two patches to stable:

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d64062b57eeb58d4928aed945515bf53f7944913
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=737298d18836fd14b8820de6504536c998986bcd

    Thanks!
    --
    Gustavo

    On 8/5/19 8:03 AM, Greg Kroah-Hartman wrote:
    > From: Gustavo A. R. Silva <gustavo@embeddedor.com>
    >
    > commit 6497d0a9c53df6e98b25e2b79f2295d7caa47b6e upstream.
    >
    > sl is controlled by user-space, hence leading to a potential
    > exploitation of the Spectre variant 1 vulnerability.
    >
    > Fix this by sanitizing sl before using it to index ibp->sl_to_sc.
    >
    > Notice that given that speculation windows are large, the policy is
    > to kill the speculation on the first load and not worry if it can be
    > completed with a dependent load/store [1].
    >
    > [1] https://lore.kernel.org/lkml/20180423164740.GY17484@dhcp22.suse.cz/
    >
    > Cc: stable@vger.kernel.org
    > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
    > Link: https://lore.kernel.org/r/20190731175428.GA16736@embeddedor
    > Signed-off-by: Doug Ledford <dledford@redhat.com>
    > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    >
    > ---
    > drivers/infiniband/hw/hfi1/verbs.c | 2 ++
    > 1 file changed, 2 insertions(+)
    >
    > --- a/drivers/infiniband/hw/hfi1/verbs.c
    > +++ b/drivers/infiniband/hw/hfi1/verbs.c
    > @@ -54,6 +54,7 @@
    > #include <linux/mm.h>
    > #include <linux/vmalloc.h>
    > #include <rdma/opa_addr.h>
    > +#include <linux/nospec.h>
    >
    > #include "hfi.h"
    > #include "common.h"
    > @@ -1587,6 +1588,7 @@ static int hfi1_check_ah(struct ib_devic
    > sl = rdma_ah_get_sl(ah_attr);
    > if (sl >= ARRAY_SIZE(ibp->sl_to_sc))
    > return -EINVAL;
    > + sl = array_index_nospec(sl, ARRAY_SIZE(ibp->sl_to_sc));
    >
    > sc5 = ibp->sl_to_sc[sl];
    > if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf)
    >
    >

    \
     
     \ /
      Last update: 2019-08-05 16:41    [W:6.701 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site