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-unstable] [XEN] Avoid void* arithmetic in kexec ELF

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Avoid void* arithmetic in kexec ELF note manipulations.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Jan 2007 11:00:13 -0800
Delivery-date: Mon, 22 Jan 2007 11:00:07 -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 Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1169479744 0
# Node ID 66cc1685d95726d93dceeee1e64f34416be2f742
# Parent  207523704fb15ae92b1852bb7e1f0e739ed01fb3
[XEN] Avoid void* arithmetic in kexec ELF note manipulations.

From: Christoph Egger <Christoph.Egger@xxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
---
 xen/common/kexec.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r 207523704fb1 -r 66cc1685d957 xen/common/kexec.c
--- a/xen/common/kexec.c        Mon Jan 22 15:15:32 2007 +0000
+++ b/xen/common/kexec.c        Mon Jan 22 15:29:04 2007 +0000
@@ -27,9 +27,9 @@ typedef long ret_t;
 typedef long ret_t;
 
 #define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
-#define ELFNOTE_NAME(_n_) ((void*)(_n_) + sizeof(*(_n_)))
+#define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
 #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
-#define ELFNOTE_NEXT(_n_) (ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz))
+#define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + 
ELFNOTE_ALIGN((_n_)->descsz)))
 
 static DEFINE_PER_CPU(void *, crash_notes);
 
@@ -75,10 +75,10 @@ void kexec_crash_save_cpu(void)
     if ( cpu_test_and_set(cpu, crash_saved_cpus) )
         return;
 
-    prstatus = ELFNOTE_DESC(note);
+    prstatus = (ELF_Prstatus *)ELFNOTE_DESC(note);
 
     note = ELFNOTE_NEXT(note);
-    xencore = ELFNOTE_DESC(note);
+    xencore = (crash_xen_core_t *)ELFNOTE_DESC(note);
 
     elf_core_save_regs(&prstatus->pr_reg, xencore);
 }
@@ -87,7 +87,7 @@ crash_xen_info_t *kexec_crash_save_info(
 crash_xen_info_t *kexec_crash_save_info(void)
 {
     int cpu = smp_processor_id();
-    crash_xen_info_t *info = ELFNOTE_DESC(xen_crash_note);
+    crash_xen_info_t *info = (crash_xen_info_t *)ELFNOTE_DESC(xen_crash_note);
 
     BUG_ON(!cpu_test_and_set(cpu, crash_saved_cpus));
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Avoid void* arithmetic in kexec ELF note manipulations., Xen patchbot-unstable <=