diff options
author | Joan Lledó <jlledom@member.fsf.org> | 2023-07-05 21:38:12 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-07-05 21:54:33 +0200 |
commit | e22f3a3170e5c3028dc83fbdfb0d8705fd00df75 (patch) | |
tree | 56b3fcbbdb0030c438151ff7f5282b9864e50748 /pci-arbiter | |
parent | 7abafc25f97897fd61762c45f8729fa952aa822c (diff) | |
download | hurd-e22f3a3170e5c3028dc83fbdfb0d8705fd00df75.tar.gz hurd-e22f3a3170e5c3028dc83fbdfb0d8705fd00df75.tar.bz2 hurd-e22f3a3170e5c3028dc83fbdfb0d8705fd00df75.zip |
pci-arbiter: Prevent mapping IO regions
* pci-arbiter/netfs_impl.c:
* get_filemap_region(): Return MACH_PORT_NULL and set errno to EOPNOTSUPP
when the client tries to map a IO region file.
Message-Id: <20230705193812.6384-2-jlledom@mailfence.com>
Diffstat (limited to 'pci-arbiter')
-rw-r--r-- | pci-arbiter/netfs_impl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pci-arbiter/netfs_impl.c b/pci-arbiter/netfs_impl.c index b66f0019..4bb5c97a 100644 --- a/pci-arbiter/netfs_impl.c +++ b/pci-arbiter/netfs_impl.c @@ -583,6 +583,9 @@ get_filemap_region (struct node *node, vm_prot_t prot) strtol (&node->nn->ln->name[strlen (node->nn->ln->name) - 1], 0, 16); region = &node->nn->ln->device->regions[reg_num]; + if (region->is_IO) + goto error; + /* Ensure the region is mapped */ err = device_map_region (node->nn->ln->device, region, &node->nn->ln->region_maps[reg_num]); |