diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-06-16 13:02:07 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-06-17 09:24:10 +0200 |
commit | d382c5be4cc24597d5d12800558e537bbc12a71a (patch) | |
tree | 332cc9d45480a34ac4b702c31afd4d2466de1937 | |
parent | 6ef43d273e8562366035d8086008e4000a270fd8 (diff) | |
download | linux-d382c5be4cc24597d5d12800558e537bbc12a71a.tar.bz2 |
media: dvb_ca_en50221: avoid speculation from CA slot
As warned by smatch:
drivers/media/dvb-core/dvb_ca_en50221.c:1392 dvb_ca_en50221_io_do_ioctl() warn: potential spectre issue 'ca->slot_info' [r] (local cap)
There's a potential of using a CAM ioctl for speculation.
The risk here is minimum, as only a small subset of DVB
boards have CI, with a CAM module installed. Also, exploiting
it would require a user capable of starting a DVB application.
There are probably a lot of easier ways to try to exploit.
Yet, it doesn't harm addressing it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/dvb-core/dvb_ca_en50221.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index b7e4a3371176..15a08d8c69ef 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -1386,6 +1386,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file, err = -EINVAL; goto out_unlock; } + slot = array_index_nospec(slot, ca->slot_count); info->type = CA_CI_LINK; info->flags = 0; |