From: Christian Engelmayer <christian.engelmayer@frequentis.com>
To: mingo@elte.hu
Cc: christian.engelmayer@frequentis.com, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] scheduler: access to variable out of scope in sched_slice()
Date: Tue, 16 Jun 2009 10:35:12 +0200 [thread overview]
Message-ID: <20090616103512.0c846e51@frequentis.com> (raw)
From: Christian Engelmayer <christian.engelmayer@frequentis.com>
Access to local variable lw is aliased by usage of pointer load. Access to
pointer load in calc_delta_mine() happens when lw is already out of scope.
Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
--
Reported by static code analysis.
--- linux-2.6.30/kernel/sched_fair.c.orig 2009-06-16 10:01:50.000000000 +0200
+++ linux-2.6.30/kernel/sched_fair.c 2009-06-16 10:02:39.000000000 +0200
@@ -430,12 +430,13 @@ static u64 sched_slice(struct cfs_rq *cf
for_each_sched_entity(se) {
struct load_weight *load;
+ struct load_weight lw;
cfs_rq = cfs_rq_of(se);
load = &cfs_rq->load;
if (unlikely(!se->on_rq)) {
- struct load_weight lw = cfs_rq->load;
+ lw = cfs_rq->load;
update_load_add(&lw, se->load.weight);
load = &lw;
next reply other threads:[~2009-06-16 8:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 8:35 Christian Engelmayer [this message]
2009-06-17 16:37 ` [PATCH 1/1] scheduler: access to variable out of scope in sched_slice() Ingo Molnar
2009-06-17 16:39 ` [tip:sched/urgent] sched: Fix out of scope variable access " tip-bot for Christian Engelmayer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090616103512.0c846e51@frequentis.com \
--to=christian.engelmayer@frequentis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox