]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dlm: fix user space lkb refcounting
authorAlexander Aring <aahringo@redhat.com>
Tue, 12 Mar 2024 17:05:07 +0000 (13:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:32 +0000 (15:28 +0200)
commit700ed41bf63ec22af3611fc32f7af4285f6aff6f
tree260e8b70e91670f133d6beae87a1ccfd7b2a71ff
parentb31301a1fa61d7a854b3a1914e8119adb799db3d
dlm: fix user space lkb refcounting

[ Upstream commit 2ab3d705ca5d4f7ea345a21c3da41a447a549649 ]

This patch fixes to check on the right return value if it was the last
callback. The rv variable got overwritten by the return of
copy_result_to_user(). Fixing it by introducing a second variable for
the return value and don't let rv being overwritten.

Cc: stable@vger.kernel.org
Fixes: 61bed0baa4db ("fs: dlm: use a non-static queue for callbacks")
Reported-by: Valentin Vidić <vvidic@valentin-vidic.from.hr>
Closes: https://lore.kernel.org/gfs2/Ze4qSvzGJDt5yxC3@valentin-vidic.from.hr
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/dlm/user.c