lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210515171117.23240-1-khaledromdhani216@gmail.com>
Date:   Sat, 15 May 2021 18:11:17 +0100
From:   Khaled ROMDHANI <khaledromdhani216@...il.com>
To:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com
Cc:     Khaled ROMDHANI <khaledromdhani216@...il.com>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH-next] sched: Fix Dereference after null check

The group_cfs_rq derefrence the 'se' variable that could
be passed as NULL pointer. Fix this by adding a check
against the sched entity 'se' before the derefrence.

Addresses-Coverity: ("Dereference after null check")
Signed-off-by: Khaled ROMDHANI <khaledromdhani216@...il.com>
---
 kernel/sched/fair.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 161b92aa1c79..9be6cdba351d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7080,7 +7080,8 @@ static struct task_struct *pick_task_fair(struct rq *rq)
 		}
 
 		se = pick_next_entity(cfs_rq, curr);
-		cfs_rq = group_cfs_rq(se);
+		if (se)
+			cfs_rq = group_cfs_rq(se);
 	} while (cfs_rq);
 
 	return task_of(se);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ