WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.1-testing] blkback: Sanity-check nr_segments para

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] blkback: Sanity-check nr_segments parameter.
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Nov 2007 09:20:36 -0800
Delivery-date: Wed, 14 Nov 2007 09:20:51 -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@xxxxxxxxxxxxx>
# Date 1194546736 0
# Node ID aa5d92821bb28a42d02c85daf20ba8d4de986478
# Parent  d000dead48c493898be1ea3ec8e400db0e5f4670
blkback: Sanity-check nr_segments parameter.
From: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
linux-2.6.18-xen changeset:   309:cf8b6cafa2f0a8ba698322786cc78ae28a1b0f60
linux-2.6.18-xen date:        Thu Nov 08 18:26:08 2007 +0000
---
 linux-2.6-xen-sparse/include/xen/blkif.h |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r d000dead48c4 -r aa5d92821bb2 linux-2.6-xen-sparse/include/xen/blkif.h
--- a/linux-2.6-xen-sparse/include/xen/blkif.h  Tue Nov 06 11:50:32 2007 +0000
+++ b/linux-2.6-xen-sparse/include/xen/blkif.h  Thu Nov 08 18:32:16 2007 +0000
@@ -72,25 +72,29 @@ enum blkif_protocol {
 
 static void inline blkif_get_x86_32_req(blkif_request_t *dst, 
blkif_x86_32_request_t *src)
 {
-       int i;
+       int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST;
        dst->operation = src->operation;
        dst->nr_segments = src->nr_segments;
        dst->handle = src->handle;
        dst->id = src->id;
        dst->sector_number = src->sector_number;
-       for (i = 0; i < src->nr_segments; i++)
+       if (n > src->nr_segments)
+               n = src->nr_segments;
+       for (i = 0; i < n; i++)
                dst->seg[i] = src->seg[i];
 }
 
 static void inline blkif_get_x86_64_req(blkif_request_t *dst, 
blkif_x86_64_request_t *src)
 {
-       int i;
+       int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST;
        dst->operation = src->operation;
        dst->nr_segments = src->nr_segments;
        dst->handle = src->handle;
        dst->id = src->id;
        dst->sector_number = src->sector_number;
-       for (i = 0; i < src->nr_segments; i++)
+       if (n > src->nr_segments)
+               n = src->nr_segments;
+       for (i = 0; i < n; i++)
                dst->seg[i] = src->seg[i];
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] blkback: Sanity-check nr_segments parameter., Xen patchbot-3.1-testing <=