]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
habanalabs: fix potential race in interrupt wait ioctl
authorOfir Bitton <obitton@habana.ai>
Mon, 30 Aug 2021 12:02:09 +0000 (15:02 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 14 Sep 2021 12:00:03 +0000 (15:00 +0300)
commitd53c66594dc7606b191bb2976901a691d291a316
tree96c645eb65a227e51abb0fab7481e9cdb7cd5f05
parent25a1433216489de4abc889910f744e952cb6dbae
habanalabs: fix potential race in interrupt wait ioctl

We have a potential race where a user interrupt can be received
in between user thread value comparison and before request was
added to wait list. This means that if no consecutive interrupt
will be received, user thread will timeout and fail.

The solution is to add the request to wait list before we
perform the comparison.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_submission.c