OSDN Git Service

scsi: ufs: Protect PM ops and err_handler from user access through sysfs
authorCan Guo <cang@codeaurora.org>
Thu, 14 Jan 2021 03:13:28 +0000 (19:13 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jan 2021 03:12:35 +0000 (22:12 -0500)
commit9cd20d3f473619d8d482551d15d4cebfb3ce73c8
tree73f24cb761cd4804be628e9306c242c5fe0f4b94
parentfb7afe24ba1b7e27483be7d2ac3ed002e67eecd5
scsi: ufs: Protect PM ops and err_handler from user access through sysfs

User layer may access sysfs nodes when system PM ops or error handling is
running. This can cause various problems. Rename eh_sem to host_sem and use
it to protect PM ops and error handling from user layer intervention.

Link: https://lore.kernel.org/r/1610594010-7254-3-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-sysfs.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h