diff options
author | Damien Zammit <damien@zamaudio.com> | 2021-08-24 13:58:00 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-08-24 13:58:00 +0200 |
commit | c2a38a627251956e80826496e958b3c80a24837e (patch) | |
tree | 4ca9c40d5e322e34b7946660065e18bfdf593fa3 /rumpdisk | |
parent | 517edb7fe7c614a683e18671afc52de8cabe8fdf (diff) | |
download | hurd-c2a38a627251956e80826496e958b3c80a24837e.tar.gz hurd-c2a38a627251956e80826496e958b3c80a24837e.tar.bz2 hurd-c2a38a627251956e80826496e958b3c80a24837e.zip |
rumpdisk: Ensure physical allocation of memory for DMA reads
* rumpdisk/block-rump.c (rumpdisk_device_read): Memset the buffer
after allocating it.
Diffstat (limited to 'rumpdisk')
-rw-r--r-- | rumpdisk/block-rump.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c index 224e4e5b..5477d886 100644 --- a/rumpdisk/block-rump.c +++ b/rumpdisk/block-rump.c @@ -326,6 +326,9 @@ rumpdisk_device_read (void *d, mach_port_t reply_port, if (ret != KERN_SUCCESS) return ENOMEM; + /* Ensure physical allocation. */ + memset (buf, 0, npages * pagesize); + err = rump_sys_pread (bd->rump_fd, (void *)buf, (size_t)count, (off_t)bn * bd->block_size); if (err < 0) { |