Commit 1d5ad0a8 authored by Eddie James's avatar Eddie James Committed by Greg Kroah-Hartman
Browse files

fsi: occ: Prevent use after free



[ Upstream commit d3e1e246 ]

Use get_device and put_device in the open and close functions to
make sure the device doesn't get freed while a file descriptor is
open.
Also, lock around the freeing of the device buffer and check the
buffer before using it in the submit function.

Signed-off-by: default avatarEddie James <eajames@linux.ibm.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220513194424.53468-1-eajames@linux.ibm.com


Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fbcf7624
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment