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

Bug#349204: libc0.3: mlock() fails on anything else than stack on hurd/mach



Package: libc0.3
Version: 2.3.5-7
Severity: normal
Tags: patch upstream

Hi,

mlock() fails with KERN_FAILURE on anything else than stack on
Hurd/Mach.  That makes gpg always fail, hence preventing root from
checking package signatures.  Details can be found on Savannah:
https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=15403

Here is a patch that should work for every useful case (only
non-readable pages will still not work, but it shouldn't hurt any
program).

A better solution is being considered, but will probably not be agreed
on shortly, so the attached patch is a sufficient replacement for now.

Regards,
Samuel

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU 0.3
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)

-- no debconf information

-- 
Samuel Thibault <samuel.thibault@ens-lyon.org>
[glibc]/ChangeLog
2006-01-18  Samuel Thibault  <samuel.thibault@ens-lyon.org>

	Fix mlock() in all cases except non-readable pages.

	* glibc/sysdeps/mach/hurd/mlock.c (mlock): Give VM_PROT_READ
	instead of VM_PROT_ALL as parameter to __vm_wire function.

--- glibc/sysdeps/mach/hurd/mlock.c	2006-01-18 23:21:11.000000000 +0100
+++ glibc/sysdeps/mach/hurd/mlock.c	2006-01-18 13:35:56.000000000 +0100
@@ -40,7 +40,7 @@ mlock (const void *addr, size_t len)
   page = trunc_page ((vm_address_t) addr);
   len = round_page ((vm_address_t) addr + len) - page;
   err = __vm_wire (hostpriv, __mach_task_self (), page, len,
-		   VM_PROT_ALL); /* XXX ? */
+		   VM_PROT_READ);
   __mach_port_deallocate (__mach_task_self (), hostpriv);
 
   return err ? __hurd_fail (err) : 0;

Reply to: