mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
misc: nsm: do not unlock mutex before locking it
nsm_dev_ioctl() jumps to the common out label when the initial copy_from_user() fails. That failure path runs before mutex_lock(&nsm->lock), but the out label unconditionally calls mutex_unlock(&nsm->lock). Return -EFAULT directly for the pre-lock copy_from_user() failure so only paths that acquired the mutex release it. Signed-off-by: Vu Nguyen Anh Khoa <khoavna.tin.2225@gmail.com> Reviewed-by: Alexander Graf <graf@amazon.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20260621085743.76329-2-khoavna.tin.2225@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6994c8b4ef
commit
937cd823bb
1 changed files with 1 additions and 2 deletions
Loading…
Add table
Add a link
Reference in a new issue