Unverified Commit 67136914 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14348 ksmbd: fix use-after-free in SMB request handling

parents c2f1662c 90026fa0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -276,8 +276,12 @@ static void handle_ksmbd_work(struct work_struct *wk)
	 * disconnection. waitqueue_active is safe because it
	 * uses atomic operation for condition.
	 */
	atomic_inc(&conn->refcnt);
	if (!atomic_dec_return(&conn->r_count) && waitqueue_active(&conn->r_count_q))
		wake_up(&conn->r_count_q);

	if (atomic_dec_and_test(&conn->refcnt))
		kfree(conn);
}

/**