misc: fastrpc: Don't remove map on creater_process and device_release
stable inclusion from stable-v5.10.165 commit 193cd853145b63e670bd73740250983af1475330 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=193cd853145b63e670bd73740250983af1475330 -------------------------------- commit 5bb96c8f upstream. Do not remove the map from the list on error path in fastrpc_init_create_process, instead call fastrpc_map_put, to avoid use-after-free. Do not remove it on fastrpc_device_release either, call fastrpc_map_put instead. The fastrpc_free_map is the only proper place to remove the map. This is called only after the reference count is 0. Fixes: b49f6d83 ("misc: fastrpc: Fix a possible double free") Cc: stable <stable@kernel.org> Co-developed-by:Ola Jeppsson <ola@snap.com> Signed-off-by:
Ola Jeppsson <ola@snap.com> Signed-off-by:
Abel Vesa <abel.vesa@linaro.org> Signed-off-by:
Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20221124174941.418450-3-srinivas.kandagatla@linaro.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment