[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 01/64: Deal with odd kernel behavior
From: |
Samuel Thibault |
Subject: |
[hurd] 01/64: Deal with odd kernel behavior |
Date: |
Wed, 10 Dec 2014 15:17:02 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 94b2c453829b3aebdaccf7d3d252136b283002b3
Author: Samuel Thibault <address@hidden>
Date: Sun Nov 9 22:31:21 2014 +0100
Deal with odd kernel behavior
Some versions of gnumach actually take address as a mapping hint, and would
fail
if the hint is bogus. Make sure to pass 0 for those versions.
* console/pager.c (user_pager_create): Make sure to set *user to 0 before
calling vm_map.
* libdiskfs/disk-pager.c (diskfs_start_disk_pager): Make sure to set *image
to 0
before calling vm_map.
* libpager/pager-memcpy.c (pager_memcpy): Set window to 0 before calling
vm_map.
* tmpfs/node.c (diskfs_get_filemap): Make sure to set np->dn->u.reg.memref
to 0
before calling vm_map.
---
console/pager.c | 1 +
libdiskfs/disk-pager.c | 1 +
libpager/pager-memcpy.c | 2 +-
tmpfs/node.c | 1 +
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/console/pager.c b/console/pager.c
index 3568211..5e13ba4 100644
--- a/console/pager.c
+++ b/console/pager.c
@@ -169,6 +169,7 @@ user_pager_create (struct user_pager *user_pager, unsigned
int npages,
mach_port_insert_right (mach_task_self (), user_pager->memobj,
user_pager->memobj, MACH_MSG_TYPE_MAKE_SEND);
+ *user = 0;
err = vm_map (mach_task_self (),
(vm_address_t *) user,
(vm_size_t) npages * vm_page_size,
diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c
index 4083ef2..008aa2d 100644
--- a/libdiskfs/disk-pager.c
+++ b/libdiskfs/disk-pager.c
@@ -60,6 +60,7 @@ diskfs_start_disk_pager (struct user_pager_info *upi,
MACH_MSG_TYPE_MAKE_SEND);
/* Now map the disk image. */
+ *image = 0;
err = vm_map (mach_task_self (), (vm_address_t *)image, size,
0, 1, disk_pager_port, 0, 0,
VM_PROT_READ | (diskfs_readonly ? 0 : VM_PROT_WRITE),
diff --git a/libpager/pager-memcpy.c b/libpager/pager-memcpy.c
index f2be558..479c06f 100644
--- a/libpager/pager-memcpy.c
+++ b/libpager/pager-memcpy.c
@@ -45,7 +45,7 @@ pager_memcpy (struct pager *pager, memory_object_t memobj,
#define VMCOPY_WINDOW_DEFAULT_SIZE (32 * vm_page_size)
#define MEMCPY_WINDOW_DEFAULT_SIZE (32 * vm_page_size)
- vm_address_t window;
+ vm_address_t window = 0;
vm_size_t window_size;
error_t do_vm_copy (void)
diff --git a/tmpfs/node.c b/tmpfs/node.c
index acc029a..8835e3f 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -508,6 +508,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
/* XXX we need to keep a reference to the object, or GNU Mach
will terminate it when we release the map. */
+ np->dn->u.reg.memref = 0;
vm_map (mach_task_self (), &np->dn->u.reg.memref, 4096, 0, 1,
np->dn->u.reg.memobj, 0, 0, VM_PROT_NONE, VM_PROT_NONE,
VM_INHERIT_NONE);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 53/64: term: add a payload-aware intrans function, (continued)
- [hurd] 53/64: term: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 57/64: trans/streamio: make the translator payload-aware, Samuel Thibault, 2014/12/10
- [hurd] 64/64: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/12/10
- [hurd] 04/64: Fix mach-defpager's kalloc values, Samuel Thibault, 2014/12/10
- [hurd] 06/64: utils/rpctrace: fix crash while printing messages, Samuel Thibault, 2014/12/10
- [hurd] 03/64: Avoid hitting VM_MAX_ADDRESS, Samuel Thibault, 2014/12/10
- [hurd] 05/64: Make procfs appear in /proc/mounts, Samuel Thibault, 2014/12/10
- [hurd] 08/64: Fix recording complete path of passive relative translators, Samuel Thibault, 2014/12/10
- [hurd] 07/64: Let pty readers always read end of writer output, Samuel Thibault, 2014/12/10
- [hurd] 54/64: trans/fakeroot: make the demuxer payload-aware, Samuel Thibault, 2014/12/10
- [hurd] 01/64: Deal with odd kernel behavior,
Samuel Thibault <=
- [hurd] 02/64: Deal with odd kernel behavior, Samuel Thibault, 2014/12/10