From: Olaf Hering <olaf@aepfle.de>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Sander Eikelenboom <linux@eikelenboom.it>,
stefano.stabellini@eu.citrix.com,
Ian Campbell <Ian.Campbell@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: xen-unstable stubdom build-failure when debug=n
Date: Tue, 22 Jul 2014 08:13:52 +0200 [thread overview]
Message-ID: <20140722061352.GA1731@aepfle.de> (raw)
In-Reply-To: <53CD5845.9090400@tycho.nsa.gov>
On Mon, Jul 21, Daniel De Graaf wrote:
> In that case, shouldn't the error be phrased less severely (something like "might be
> below array bounds")? Anyway, the actual value is checked by locality_enabled
> prior to the array access, and that check is effectively (0x1F & (1 << locality)),
> limiting the actual value to 0..4. I can't reproduce the warning with my version
> of GCC, so I'm only looking at the code, but it looks like GCC is being overly
> conservative after not detecting the range limit and this is just a false positive.
So how should we proceed here? Adjust the code to use unsigned array
indices, or drop support for gcc versions as shipped with sle11 (gcc 4.3)?
Of adjust the code like this:
diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
index e8ca69f..dc4134a 100644
--- a/extras/mini-os/tpm_tis.c
+++ b/extras/mini-os/tpm_tis.c
@@ -611,7 +611,7 @@ s_time_t tpm_calc_ordinal_duration(struct tpm_chip *chip,
static int locality_enabled(struct tpm_chip* tpm, int l) {
- return tpm->enabled_localities & (1 << l);
+ return l >= 0 && tpm->enabled_localities & (1 << l);
}
static int check_locality(struct tpm_chip* tpm, int l) {
Olaf
next prev parent reply other threads:[~2014-07-22 6:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 8:27 xen-unstable stubdom build-failure when debug=n Sander Eikelenboom
2014-07-17 14:13 ` Ian Campbell
2014-07-17 14:25 ` Sander Eikelenboom
2014-07-21 16:13 ` Ian Campbell
2014-07-21 16:21 ` Olaf Hering
2014-07-21 16:27 ` Ian Campbell
2014-07-22 7:09 ` Olaf Hering
2014-07-21 16:31 ` Olaf Hering
2014-07-21 16:43 ` Olaf Hering
2014-07-21 16:48 ` Ian Campbell
2014-07-21 16:51 ` Olaf Hering
2014-07-21 16:24 ` Ian Campbell
2014-07-21 17:43 ` Olaf Hering
2014-07-21 18:13 ` Daniel De Graaf
2014-07-22 6:13 ` Olaf Hering [this message]
2014-07-22 7:11 ` Sander Eikelenboom
2014-07-26 15:14 ` Sander Eikelenboom
2014-07-28 9:09 ` Ian Campbell
2014-07-28 9:47 ` Sander Eikelenboom
2014-07-28 9:51 ` Ian Campbell
2014-07-28 9:55 ` Olaf Hering
2014-07-28 9:22 ` Ian Campbell
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=20140722061352.GA1731@aepfle.de \
--to=olaf@aepfle.de \
--cc=Ian.Campbell@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=linux@eikelenboom.it \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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;
as well as URLs for NNTP newsgroup(s).