linux-stable/drivers/ptp
Gustavo A. R. Silva 7a4b046b0c ptp: fix Spectre v1 vulnerability
commit efa61c8cf2 upstream.

pin_index can be 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:

drivers/ptp/ptp_chardev.c:253 ptp_ioctl() warn: potential spectre issue
'ops->pin_config' [r] (local cap)

Fix this by sanitizing pin_index before using it to index
ops->pin_config, and before passing it as an argument to
function ptp_set_pinfunc(), in which it is used to index
info->pin_config.

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://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-10 07:48:34 -08:00
..
Kconfig ptp: Add a ptp clock driver for Broadcom DTE 2017-06-15 12:07:15 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptp_chardev.c ptp: fix Spectre v1 vulnerability 2018-11-10 07:48:34 -08:00
ptp_clock.c ptp: introduce ptp auxiliary worker 2017-08-01 15:22:55 -07:00
ptp_dte.c ptp: make ptp_clock_info const 2017-08-22 11:04:51 -07:00
ptp_ixp46x.c ptp: make ptp_clock_info const 2017-08-22 11:04:51 -07:00
ptp_kvm.c ptp: make ptp_clock_info const 2017-08-22 11:04:51 -07:00
ptp_pch.c ptp: make ptp_clock_info const 2017-08-22 11:04:51 -07:00
ptp_private.h ptp: introduce ptp auxiliary worker 2017-08-01 15:22:55 -07:00
ptp_sysfs.c ptp: create "pins" together with the rest of attributes 2017-02-17 11:03:06 -05:00