fs: dlm: fix possible use after free if tracing
authorAlexander Aring <aahringo@redhat.com>
Thu, 1 Sep 2022 16:05:32 +0000 (12:05 -0400)
committerDavid Teigland <teigland@redhat.com>
Mon, 26 Sep 2022 14:58:07 +0000 (09:58 -0500)
commit3b7610302a75fc1032a6c9462862bec6948f85c9
tree33b042a6dd910cf283144770ee9000e49b554205
parent56171e0db23a5e0edce1596dd2792b95ffe57bd3
fs: dlm: fix possible use after free if tracing

This patch fixes a possible use after free if tracing for the specific
event is enabled. To avoid the use after free we introduce a out_put
label like all other user lock specific requests and safe in a boolean
to do a put or not which depends on the execution path of
dlm_user_request().

Cc: stable@vger.kernel.org
Fixes: 7a3de7324c2b ("fs: dlm: trace user space callbacks")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lock.c