]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
applicom: Fix potential Spectre v1 vulnerabilities
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Wed, 9 Jan 2019 22:05:10 +0000 (16:05 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Mar 2019 06:10:15 +0000 (07:10 +0100)
commit6ff29c0fd697bdb81e1e8ef5f8e2dcc29eec8884
tree7846595de8776967d9c0b6f8d16765e11c662b49
parent57c5084e478cfb9b3cc85070b8d91ed4bff4aa28
applicom: Fix potential Spectre v1 vulnerabilities

commit d7ac3c6ef5d8ce14b6381d52eb7adafdd6c8bb3c upstream.

IndexCard 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:

drivers/char/applicom.c:418 ac_write() warn: potential spectre issue 'apbs' [r]
drivers/char/applicom.c:728 ac_ioctl() warn: potential spectre issue 'apbs' [r] (local cap)

Fix this by sanitizing IndexCard before using it to index apbs.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/applicom.c