os.ftruncate(self.fs_shm_f, (128<<10))#os.ftruncate(argv_fd, (4 << 10))self.kafl_shm = mmap.mmap(self.kafl_shm_f, self.bitmap_size, mmap.MAP_SHARED, mmap.PROT_WRITE | mmap.PROT_READ) self.fs_shm = mmap.mmap(self.fs_shm_f, (128<<10), mmap.MAP_SHARED, mmap.PROT_WRITE...
{void*mapaddr;//核心便是这句 mmap,其中要注意的是 offset 必须为 0mapaddr = mmap(requested_addr, size, PROT_READ |PROT_WRITE, MAP_SHARED|additional_flags, fd, offset);if(mapaddr ==MAP_FAILED) { RTE_LOG(ERR, EAL,"%s(): cannot mmap(%d, %p, 0x%zx, 0x%llx): %s (%p)\n", __...
If the mmap didn’t fail like this, you’d get a code signing crash when you touched the mapped page because there’s no hash to allow the pager to verify that the code is intact [3]. The obvious fix is to map the file back in as read-only data (PROT_READ) but that’s clearl...