All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm_timer.c: Fix bounds check for Integrator timer accesses
@ 2011-11-11 13:30 Peter Maydell
  2011-11-11 19:46 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-11-11 13:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

There are only three counter/timers on the integrator board:
correct the bounds check to avoid an array overrun. (Spotted
by Coverity, see bug 887883).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm_timer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm_timer.c b/hw/arm_timer.c
index 09a4b24..66db81d 100644
--- a/hw/arm_timer.c
+++ b/hw/arm_timer.c
@@ -269,7 +269,7 @@ static uint64_t icp_pit_read(void *opaque, target_phys_addr_t offset,
 
     /* ??? Don't know the PrimeCell ID for this device.  */
     n = offset >> 8;
-    if (n > 3) {
+    if (n > 2) {
         hw_error("sp804_read: Bad timer %d\n", n);
     }
 
@@ -283,7 +283,7 @@ static void icp_pit_write(void *opaque, target_phys_addr_t offset,
     int n;
 
     n = offset >> 8;
-    if (n > 3) {
+    if (n > 2) {
         hw_error("sp804_write: Bad timer %d\n", n);
     }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm_timer.c: Fix bounds check for Integrator timer accesses
  2011-11-11 13:30 [Qemu-devel] [PATCH] hw/arm_timer.c: Fix bounds check for Integrator timer accesses Peter Maydell
@ 2011-11-11 19:46 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2011-11-11 19:46 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On 11/11/2011 07:30 AM, Peter Maydell wrote:
> There are only three counter/timers on the integrator board:
> correct the bounds check to avoid an array overrun. (Spotted
> by Coverity, see bug 887883).
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   hw/arm_timer.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm_timer.c b/hw/arm_timer.c
> index 09a4b24..66db81d 100644
> --- a/hw/arm_timer.c
> +++ b/hw/arm_timer.c
> @@ -269,7 +269,7 @@ static uint64_t icp_pit_read(void *opaque, target_phys_addr_t offset,
>
>       /* ??? Don't know the PrimeCell ID for this device.  */
>       n = offset>>  8;
> -    if (n>  3) {
> +    if (n>  2) {
>           hw_error("sp804_read: Bad timer %d\n", n);
>       }
>
> @@ -283,7 +283,7 @@ static void icp_pit_write(void *opaque, target_phys_addr_t offset,
>       int n;
>
>       n = offset>>  8;
> -    if (n>  3) {
> +    if (n>  2) {
>           hw_error("sp804_write: Bad timer %d\n", n);
>       }
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-11 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 13:30 [Qemu-devel] [PATCH] hw/arm_timer.c: Fix bounds check for Integrator timer accesses Peter Maydell
2011-11-11 19:46 ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.