]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol()
authorYu Kuai <yukuai3@huawei.com>
Fri, 21 May 2021 12:06:17 +0000 (20:06 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:17 +0000 (09:31 +0200)
commit0b09a6a005de0cff9ffe960ace5689a0908a9315
tree8dd4f97607bb72ee8b1ad637511b1ac4236961a8
parent06bcf21e8d360d45455aea5e848ac693f10bc883
char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol()

BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit 37188559c610f1b7eec83c8e448936c361c578de ]

Theoretically, it will cause index out of bounds error if
'num_bytes_read' is greater than 4. As we expect it(and was tested)
never to be greater than 4, error out if it happens.

Fixes: c1986ee9bea3 ("[PATCH] New Omnikey Cardman 4000 driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20210521120617.138396-1-yukuai3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/char/pcmcia/cm4000_cs.c