commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 01/01: Fix random translator crash during heimdal testsuite.


From: Samuel Thibault
Subject: [hurd] 01/01: Fix random translator crash during heimdal testsuite.
Date: Fri, 30 May 2014 18:25:08 +0000

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

sthibault pushed a commit to branch master
in repository hurd.

commit 3888e7ffa2414fa32775b1c75a8f90ec61314630
Author: Samuel Thibault <address@hidden>
Date:   Fri May 30 20:24:54 2014 +0200

    Fix random translator crash during heimdal testsuite.
---
 debian/changelog                       |  4 ++++
 debian/patches/git-random_buffer.patch | 39 ++++++++++++++++++++++++++++++++++
 debian/patches/series                  |  1 +
 3 files changed, 44 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7e78603..d3fb8c5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,10 @@ hurd (1:0.5.git20140526-2) UNRELEASED; urgency=medium
   [ Gabriele Giacone ]
   * patches/mount-bind.patch: Fix uninitialized value.
 
+  [ Samuel Thibault ]
+  * patches/git-random_buffer.patch: Fix random translator crash during
+    heimdal testsuite.
+
  -- Samuel Thibault <address@hidden>  Tue, 27 May 2014 22:06:43 +0200
 
 hurd (1:0.5.git20140526-1) unstable; urgency=medium
diff --git a/debian/patches/git-random_buffer.patch 
b/debian/patches/git-random_buffer.patch
new file mode 100644
index 0000000..d5d5bcd
--- /dev/null
+++ b/debian/patches/git-random_buffer.patch
@@ -0,0 +1,39 @@
+diff --git a/random/random.c b/random/random.c
+index ca96358..de44f94 100644
+--- a/random/random.c
++++ b/random/random.c
+@@ -152,6 +152,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
+ 
+   if (amount > 0)
+     {
++      mach_msg_type_number_t new_amount;
+       while (readable_pool (amount, level) == 0)
+       {
+         if (cred->po->openmodes & O_NONBLOCK)
+@@ -170,10 +171,22 @@ trivfs_S_io_read (struct trivfs_protid *cred,
+ 
+       /* Possibly allocate a new buffer. */
+       if (*data_len < amount)
+-      *data = mmap (0, amount, PROT_READ|PROT_WRITE,
+-                                   MAP_ANON, 0, 0);
+-        
+-      amount = read_pool ((byte *) *data, amount, level);
++      {
++        *data = mmap (0, amount, PROT_READ|PROT_WRITE,
++                                     MAP_ANON, 0, 0);
++        if (*data == MAP_FAILED)
++          {
++            pthread_mutex_unlock (&global_lock);
++            return errno;
++          }
++      }
++
++      new_amount = read_pool ((byte *) *data, amount, level);
++
++      if (new_amount < amount)
++      munmap (*data + round_page (new_amount),
++              round_page(amount) - round_page (new_amount));
++      amount = new_amount;
+     }
+   *data_len = amount;
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 9a4cc9a..93bfb96 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -42,3 +42,4 @@ proc_set_init_task.patch
 newRPC.patch
 xkb-compat.patch
 mount-bind.patch
+git-random_buffer.patch

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



reply via email to

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