]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: sco: Fix lock_sock() blockage by memcpy_from_msg()
authorTakashi Iwai <tiwai@suse.de>
Sat, 28 Aug 2021 16:18:18 +0000 (18:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:03 +0000 (11:36 +0100)
commitc1c913f797f3d2441310182ad75b7bd855a327ff
tree245681f8c41861b1261e975d2e8ac3c7bf31e672
parent7d2eea140d33d7611118ad6f67fe0782daee8a3d
Bluetooth: sco: Fix lock_sock() blockage by memcpy_from_msg()

[ Upstream commit 99c23da0eed4fd20cae8243f2b51e10e66aa0951 ]

The sco_send_frame() also takes lock_sock() during memcpy_from_msg()
call that may be endlessly blocked by a task with userfaultd
technique, and this will result in a hung task watchdog trigger.

Just like the similar fix for hci_sock_sendmsg() in commit
92c685dc5de0 ("Bluetooth: reorganize functions..."), this patch moves
the  memcpy_from_msg() out of lock_sock() for addressing the hang.

This should be the last piece for fixing CVE-2021-3640 after a few
already queued fixes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/sco.c