]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix UAF issue from opinfo->conn
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:33:56 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:56 +0000 (10:41 +0100)
commitb423ddab61383077953b8246e6caa2cea3e446c4
tree8d3d7c81f5a4658985033d08f08ce320c1509840
parent19b2b9af315e295d3afc55ab5158f0808cb8754e
ksmbd: fix UAF issue from opinfo->conn

[ Upstream commit 36322523dddb11107e9f7f528675a0dec2536103 ]

If opinfo->conn is another connection and while ksmbd send oplock break
request to cient on current connection, The connection for opinfo->conn
can be disconnect and conn could be freed. When sending oplock break
request, this ksmbd_conn can be used and cause user-after-free issue.
When getting opinfo from the list, ksmbd check connection is being
released. If it is not released, Increase ->r_count to wait that connection
is freed.

Cc: stable@vger.kernel.org
Reported-by: Per Forlin <per.forlin@axis.com>
Tested-by: Per Forlin <per.forlin@axis.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/oplock.c