Eric Dumazet 5e9398a26a ipv4: prevent potential spectre v1 gadget in fib_metrics_match()
if (!type)
        continue;
    if (type > RTAX_MAX)
        return false;
    ...
    fi_val = fi->fib_metrics->metrics[type - 1];

@type being used as an array index, we need to prevent
cpu speculation or risk leaking kernel memory content.

Fixes: 5f9ae3d9e7e4 ("ipv4: do metrics match when looking up and deleting a route")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230120133140.3624204-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-01-23 21:37:39 -08:00
..
2021-05-17 15:29:35 -07:00
2022-11-16 12:48:44 +00:00
2022-11-16 12:48:44 +00:00
2022-11-16 12:48:44 +00:00
2022-10-28 10:47:42 +01:00
2021-05-17 15:29:35 -07:00
2022-06-21 11:38:29 +02:00
2022-06-24 22:48:33 -07:00
2022-10-28 10:47:42 +01:00
2022-09-20 10:21:49 -07:00
2022-12-13 15:47:48 -08:00
2022-12-20 03:13:45 +01:00
2021-05-17 15:29:35 -07:00
2022-11-16 09:43:35 +00:00