linux-brain/drivers/ptp
Gustavo A. R. Silva 3700bfc36c 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:41:42 -08:00
..
Kconfig ptp: ptp_pch depends on x86_32 2014-06-17 15:43:48 -07:00
Makefile supports eg20t ptp clock 2012-03-09 13:55:34 -08:00
ptp_chardev.c ptp: fix Spectre v1 vulnerability 2018-11-10 07:41:42 -08:00
ptp_clock.c time: Change posix clocks ops interfaces to use timespec64 2018-03-24 10:58:40 +01:00
ptp_ixp46x.c ptp: ixp46x: convert to the 64 bit get/set time methods. 2015-03-31 12:01:19 -04:00
ptp_pch.c ptp: pch: convert to the 64 bit get/set time methods. 2015-03-31 12:01:19 -04:00
ptp_private.h ptp: expose the programmable pins via sysfs 2014-03-21 14:21:14 -04:00
ptp_sysfs.c ptp: expose the programmable pins via sysfs 2014-03-21 14:21:14 -04:00