commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnumach] 01/01: Backport some patches from git


From: Samuel Thibault
Subject: [gnumach] 01/01: Backport some patches from git
Date: Wed, 05 Feb 2014 11:48:50 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository gnumach.

commit 195f004db961ed14405d1bbdb5070f08e599cddc
Author: Samuel Thibault <address@hidden>
Date:   Wed Feb 5 11:48:29 2014 +0000

    Backport some patches from git
    
      * patches/git-coverity-fixes.patch: New patch to fix several issues found 
by
        Coverity.
      * patches/git-mig-inlines.patch: New patch to inline MIG-generated 
demuxers.
      * control: Bump mig version dependency to get inlined MIG demuxers.
---
 debian/changelog                        |   8 ++-
 debian/control                          |   2 +-
 debian/patches/git-coverity-fixes.patch | 120 ++++++++++++++++++++++++++++++++
 debian/patches/git-mig-inlines.patch    |  88 +++++++++++++++++++++++
 debian/patches/series                   |   2 +
 5 files changed, 217 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ac8638d..76c0656 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,15 @@
-gnumach (2:1.4-3) UNRELEASED; urgency=medium
+gnumach (2:1.4-3) unstable; urgency=medium
 
   * patches/{kentry_data_size,thread_terminate_release,
     xen_clock_overflow}.patch: Add "git-" prefix to patch name.
   * patches/git-cursor_init.patch: New patch to make sure cursor is
     initialized.
+  * patches/git-coverity-fixes.patch: New patch to fix several issues found by
+    Coverity.
+  * patches/git-mig-inlines.patch: New patch to inline MIG-generated demuxers.
+  * control: Bump mig version dependency to get inlined MIG demuxers.
 
- -- Samuel Thibault <address@hidden>  Thu, 02 Jan 2014 23:29:16 +0100
+ -- Samuel Thibault <address@hidden>  Wed, 05 Feb 2014 11:47:53 +0000
 
 gnumach (2:1.4-2) unstable; urgency=medium
 
diff --git a/debian/control b/debian/control
index 0869a3b..999c5dd 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders: Guillem Jover <address@hidden>,
 Homepage: http://www.gnu.org/software/hurd/microkernel/mach/gnumach.html
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-hurd/gnumach.git
 Vcs-Git: git://anonscm.debian.org/pkg-hurd/gnumach.git
-Build-Depends: debhelper (>= 7), mig, sharutils,
+Build-Depends: debhelper (>= 7), mig (>= 1.4-2), sharutils,
  autoconf, automake, texinfo
 Standards-Version: 3.9.5
 
diff --git a/debian/patches/git-coverity-fixes.patch 
b/debian/patches/git-coverity-fixes.patch
new file mode 100644
index 0000000..685e4b1
--- /dev/null
+++ b/debian/patches/git-coverity-fixes.patch
@@ -0,0 +1,120 @@
+commit a9f5cf5d2ff55abdd05a2ab6965d8b4ba190eac9
+Author: Samuel Thibault <address@hidden>
+Date:   Tue Feb 4 13:03:48 2014 +0100
+
+    Fix FPU state access
+    
+    Found by coverity.
+    
+    * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix out of bound
+    `user_fp_regs' access.
+
+diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
+index fd5f4b6..62a4e67 100644
+--- a/i386/i386/fpu.c
++++ b/i386/i386/fpu.c
+@@ -374,7 +374,7 @@ ASSERT_IPL(SPL0);
+               ifps->xfp_save_state.fp_dp      = user_fp_state->fp_dp;
+               ifps->xfp_save_state.fp_ds      = user_fp_state->fp_ds;
+               for (i=0; i<8; i++)
+-                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs[i], sizeof(user_fp_regs[i]));
++                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs[i]));
+           } else {
+               ifps->fp_save_state.fp_control = user_fp_state->fp_control;
+               ifps->fp_save_state.fp_status  = user_fp_state->fp_status;
+@@ -467,7 +467,7 @@ ASSERT_IPL(SPL0);
+               user_fp_state->fp_dp      = ifps->xfp_save_state.fp_dp;
+               user_fp_state->fp_ds      = ifps->xfp_save_state.fp_ds;
+               for (i=0; i<8; i++)
+-                  memcpy(&user_fp_regs[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
++                  memcpy(&user_fp_regs->fp_reg_word[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
+           } else {
+               user_fp_state->fp_control = ifps->fp_save_state.fp_control;
+               user_fp_state->fp_status  = ifps->fp_save_state.fp_status;
+commit a7fcd5dfaad27dc33c1c1e22ebef2ded8d53b5a0
+Author: Samuel Thibault <address@hidden>
+Date:   Tue Feb 4 13:20:15 2014 +0100
+
+    Fix FPU state copy size
+    
+    * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix size of
+    `user_fp_regs' access.
+
+diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
+index 62a4e67..cd90ee9 100644
+--- a/i386/i386/fpu.c
++++ b/i386/i386/fpu.c
+@@ -374,7 +374,7 @@ ASSERT_IPL(SPL0);
+               ifps->xfp_save_state.fp_dp      = user_fp_state->fp_dp;
+               ifps->xfp_save_state.fp_ds      = user_fp_state->fp_ds;
+               for (i=0; i<8; i++)
+-                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs[i]));
++                  memcpy(&ifps->xfp_save_state.fp_reg_word[i], 
&user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs->fp_reg_word[i]));
+           } else {
+               ifps->fp_save_state.fp_control = user_fp_state->fp_control;
+               ifps->fp_save_state.fp_status  = user_fp_state->fp_status;
+@@ -467,7 +467,7 @@ ASSERT_IPL(SPL0);
+               user_fp_state->fp_dp      = ifps->xfp_save_state.fp_dp;
+               user_fp_state->fp_ds      = ifps->xfp_save_state.fp_ds;
+               for (i=0; i<8; i++)
+-                  memcpy(&user_fp_regs->fp_reg_word[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
++                  memcpy(&user_fp_regs->fp_reg_word[i], 
&ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs->fp_reg_word[i]));
+           } else {
+               user_fp_state->fp_control = ifps->fp_save_state.fp_control;
+               user_fp_state->fp_status  = ifps->fp_save_state.fp_status;
+commit e6f93609728d0ad864fc2d7dacd9df128eccd37a
+Author: Samuel Thibault <address@hidden>
+Date:   Tue Feb 4 19:07:47 2014 +0100
+
+    Fix potential NULL dereference
+    
+    Found by Coverity
+    
+    * i386/i386/user_ldt.c (i386_get_ldt): Fetch `pcb' field of `thread'
+    only after looking for `thread' being NULL.
+
+diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
+index a83bc12..3a2c1cc 100644
+--- a/i386/i386/user_ldt.c
++++ b/i386/i386/user_ldt.c
+@@ -262,7 +262,7 @@ i386_get_ldt(thread, first_selector, selector_count, 
desc_list, count)
+       unsigned int    *count;                 /* in/out */
+ {
+       struct user_ldt *user_ldt;
+-      pcb_t           pcb = thread->pcb;
++      pcb_t           pcb;
+       int             first_desc = sel_idx(first_selector);
+       unsigned int    ldt_count;
+       vm_size_t       ldt_size;
+@@ -276,6 +276,7 @@ i386_get_ldt(thread, first_selector, selector_count, 
desc_list, count)
+       if (first_desc + selector_count >= 8192)
+           return KERN_INVALID_ARGUMENT;
+ 
++      pcb = thread->pcb;
+       addr = 0;
+       size = 0;
+ 
+commit 03df518586e3cfd106eb20827781f12a0596e48c
+Author: Justus Winter <address@hidden>
+Date:   Tue Feb 4 11:47:00 2014 +0100
+
+    xen: fix buffer size
+    
+    Previously, only strlen(device_name) bytes were allocated, missing one
+    byte for the terminating zero.
+    
+    * xen/block.c (hyp_block_init): Fix buffer size.
+
+diff --git a/xen/block.c b/xen/block.c
+index 3e4ce7c..bd3758f 100644
+--- a/xen/block.c
++++ b/xen/block.c
+@@ -217,7 +217,7 @@ void hyp_block_init(void) {
+                       sprintf(device_name, "%s%ds%d", prefix, disk, 
partition);
+               else
+                       sprintf(device_name, "%s%d", prefix, disk);
+-              bd->name = (char*) kalloc(strlen(device_name));
++              bd->name = (char*) kalloc(strlen(device_name) + 1);
+               strcpy(bd->name, device_name);
+ 
+               /* Get domain id of backend driver.  */
diff --git a/debian/patches/git-mig-inlines.patch 
b/debian/patches/git-mig-inlines.patch
new file mode 100644
index 0000000..e95c225
--- /dev/null
+++ b/debian/patches/git-mig-inlines.patch
@@ -0,0 +1,88 @@
+commit 1b929c6f3ac51372914c4c0d49be8f27caee5ca5
+Author: Justus Winter <address@hidden>
+Date:   Thu Jan 16 14:47:38 2014 +0100
+
+    vm: remove the declaration of memory_object_create_proxy
+    
+    It is not clear to me why the declaration was put there in the first
+    place.  It is not used anywhere, and it conflicts with the declaration
+    generated by mig.
+    
+    * vm/memory_object_proxy.h (memory_object_create_proxy): Remove 
declaration.
+
+diff --git a/vm/memory_object_proxy.h b/vm/memory_object_proxy.h
+index 3de6996..dc0ea74 100644
+--- a/vm/memory_object_proxy.h
++++ b/vm/memory_object_proxy.h
+@@ -30,17 +30,6 @@
+ 
+ extern void memory_object_proxy_init (void);
+ extern boolean_t memory_object_proxy_notify (mach_msg_header_t *msg);
+-extern kern_return_t memory_object_create_proxy (const ipc_space_t space,
+-                                                 vm_prot_t max_protection,
+-                                                 ipc_port_t *object,
+-                                                 natural_t object_count,
+-                                                 const vm_offset_t *offset,
+-                                                 natural_t offset_count,
+-                                                 const vm_offset_t *start,
+-                                                 natural_t start_count,
+-                                                 const vm_offset_t *len,
+-                                                 natural_t len_count,
+-                                                 ipc_port_t *port);
+ extern kern_return_t memory_object_proxy_lookup (ipc_port_t port,
+                                                  ipc_port_t *object,
+                                                  vm_prot_t *max_protection);
+commit 62ca925c9a6b0d12bdf17ac4ab93f5434575cedc
+Author: Justus Winter <address@hidden>
+Date:   Thu Jan 16 14:50:31 2014 +0100
+
+    kern: include the mig-generated server headers in ipc_kobject.c
+    
+    GNU MIG recently gained support for emitting x_server_routine
+    declarations in the generated server header file.  Using this
+    declaration, the x_server_routine functions can be inlined into the
+    ipc_kobject_server function.
+    
+    * kern/ipc_kobject.c: Include the mig-generated server headers.
+
+diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c
+index 37d4eb9..13af820 100644
+--- a/kern/ipc_kobject.c
++++ b/kern/ipc_kobject.c
+@@ -49,6 +49,18 @@
+ #include <vm/memory_object_proxy.h>
+ #include <device/ds_routines.h>
+ 
++#include <kern/mach.server.h>
++#include <ipc/mach_port.server.h>
++#include <kern/mach_host.server.h>
++#include <device/device.server.h>
++#include <device/device_pager.server.h>
++#include <kern/mach4.server.h>
++#include <kern/gnumach.server.h>
++
++#if MACH_DEBUG
++#include <kern/mach_debug.server.h>
++#endif
++
+ #if   MACH_MACHINE_ROUTINES
+ #include <machine/machine_routines.h>
+ #endif
+@@ -146,17 +158,6 @@ ipc_kobject_server(request)
+        * to perform the kernel function
+        */
+     {
+-      extern mig_routine_t    mach_server_routine(),
+-                              mach_port_server_routine(),
+-                              mach_host_server_routine(),
+-                              device_server_routine(),
+-                              device_pager_server_routine(),
+-                              mach4_server_routine(),
+-                              gnumach_server_routine();
+-#if   MACH_DEBUG
+-      extern mig_routine_t    mach_debug_server_routine();
+-#endif
+-
+ #if   MACH_MACHINE_ROUTINES
+       extern mig_routine_t    MACHINE_SERVER_ROUTINE();
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index b41ca4a..d4ca4de 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,5 @@ git-kentry_data_size.patch
 git-thread_terminate_release.patch
 git-xen_clock_overflow.patch
 git-cursor_init.patch
+git-coverity-fixes.patch
+git-mig-inlines.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/gnumach.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]