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: <20210515164645.22849-1-khaledromdhani216@gmail.com>
Date:   Sat, 15 May 2021 17:46:45 +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 Null pointer derefrence

The 'curr' variable could be NULL and derefrenced by
pick_next_entity. Fix this by adding a check that prevent
the invocation of pick_next_entity with a NULL passed argument.

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

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 161b92aa1c79..490948df94fe 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7075,7 +7075,7 @@ static struct task_struct *pick_task_fair(struct rq *rq)
 			else
 				curr = NULL;
 
-			if (unlikely(check_cfs_rq_runtime(cfs_rq)))
+			if (unlikely(check_cfs_rq_runtime(cfs_rq) || !curr))
 				goto again;
 		}
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ