From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Olaf Hering <olaf@aepfle.de>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
xen-devel@lists.xen.org, Ian Campbell <Ian.Campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 1/3] mini-os: tpm: fix array access in locality_enabled
Date: Tue, 22 Jul 2014 09:28:52 +0200 [thread overview]
Message-ID: <20140722072852.GG5496@type.youpi.perso.aquilenet.fr> (raw)
In-Reply-To: <1406013557-11699-2-git-send-email-olaf@aepfle.de>
Olaf Hering, le Tue 22 Jul 2014 09:19:15 +0200, a écrit :
> gcc-4.3 fails to prove that array indices will remain positive. Add a
> hint for the compiler and check the index value before using it.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
> extras/mini-os/tpm_tis.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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) {
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>
--
Samuel
"2 + 2 = 5 pour d'assez grandes valeurs de 2"
next prev parent reply other threads:[~2014-07-22 7:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 7:19 [PATCH 0/3] tools: vtpm compile fixes Olaf Hering
2014-07-22 7:19 ` [PATCH 1/3] mini-os: tpm: fix array access in locality_enabled Olaf Hering
2014-07-22 7:28 ` Samuel Thibault [this message]
2014-07-22 7:19 ` [PATCH 2/3] mini-os: tpm: remove usage of inline keyword Olaf Hering
2014-07-22 7:30 ` Samuel Thibault
2014-07-22 7:19 ` [PATCH 3/3] stubdom: fix -Wextra usage in vtpm_emulator Olaf Hering
2014-07-22 7:29 ` Samuel Thibault
2014-07-24 15:52 ` [PATCH 0/3] tools: vtpm compile fixes 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=20140722072852.GG5496@type.youpi.perso.aquilenet.fr \
--to=samuel.thibault@ens-lyon.org \
--cc=Ian.Campbell@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=olaf@aepfle.de \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.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).