This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [linux-2.6.18-xen] cpufreq: add bounds checking to cpufr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] cpufreq: add bounds checking to cpufreq_stats.c from upstream
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Dec 2007 14:00:12 -0800
Delivery-date: Fri, 14 Dec 2007 14:00:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197631720 0
# Node ID fc406f9e9a0a8115b0b37e8c7fe37b1879c6a713
# Parent  2e33f7c0f18a7e4a257d806f25d0630737e93295
cpufreq: add bounds checking to cpufreq_stats.c from upstream

The cpufreq_stats.c will attempt to use an error return value as
an index to an array, causing the kernel to oops.  Stop that by
doing bounds checking.

This is a backport of upstream code.

Signed-off-by: Mark Langsdorf <mark.langsdorf@xxxxxxx>
 drivers/cpufreq/cpufreq_stats.c |    3 +++
 1 files changed, 3 insertions(+)

diff -r 2e33f7c0f18a -r fc406f9e9a0a drivers/cpufreq/cpufreq_stats.c
--- a/drivers/cpufreq/cpufreq_stats.c   Fri Dec 14 10:20:34 2007 +0000
+++ b/drivers/cpufreq/cpufreq_stats.c   Fri Dec 14 11:28:40 2007 +0000
@@ -292,6 +292,9 @@ cpufreq_stat_notifier_trans (struct noti
        if (old_index == new_index)
                return 0;
+        if ((old_index < 0) || (new_index < 0))
+                return 0;
        stat->last_index = new_index;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] cpufreq: add bounds checking to cpufreq_stats.c from upstream, Xen patchbot-linux-2.6.18-xen <=