Commit 67dfc645 authored by Wu Bo's avatar Wu Bo Committed by Yang Yingliang
Browse files

scsi: sg: add sg_remove_request in sg_write

mainline inclusion
from mainline-v5.7-rc3
commit 83c6f239
category: bugfix
bugzilla: 13690
CVE: CVE-2020-12770

-------------------------------------------------

If the __copy_from_user function failed we need to call sg_remove_request
in sg_write.

Link: https://lore.kernel.org/r/610618d9-e983-fd56-ed0f-639428343af7@huawei.com


Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarWu Bo <wubo40@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Conflicts:
  drivers/scsi/sg.c
[yyl: adjust context]

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent cbe6c152
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment