Commit fad14eb9 authored by Hui Tang's avatar Hui Tang
Browse files

sched: fix a deadlock in task_net_group()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IATU6E


CVE: NA

--------------------------------

If req->tx_pid == req->tx_pid when sched_net_relationship_submit() called,
which cause rship->net_lock AA deadlock in task_net_group().

Fixes: 2ac826b2 ("sched: Introduce task relationship by net and memory")
Signed-off-by: default avatarHui Tang <tanghui20@huawei.com>
parent ed67c0a8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -141,6 +141,9 @@ int sched_net_relationship_submit(struct net_relationship_req *req)
	    req->net_rship_type == NET_RS_TYPE_TX)
		return remote_rxtx_process(req);

	if (req->rx_pid == req->tx_pid)
		return -EINVAL;

	rcu_read_lock();

	rx_tsk = find_task_by_pid_ns(req->rx_pid, &init_pid_ns);