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: 2ac826b258e9 ("sched: Introduce task relationship by net and memory") Signed-off-by: Hui Tang tanghui20@huawei.com --- kernel/sched/relationship.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/kernel/sched/relationship.c b/kernel/sched/relationship.c index 515c913aeb33..d17041585c39 100644 --- a/kernel/sched/relationship.c +++ b/kernel/sched/relationship.c @@ -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);