简体   繁体   English

linux中具有相同虚拟和物理地址空间的两个进程(共享大页面)

[英]Two processes with same virtual and physical address space in linux(shared huge pages)

I am aware of the shared memory creation(with normal pages), where the virtual addresses of the process which creates and the virtual address of process which attaches to it are different. 我知道共享内存的创建(带有普通页面),其中创建的进程的虚拟地址和附加到该进程的虚拟地址是不同的。 But they internally will be mapped to the same physical address frame. 但是它们在内部将被映射到相同的物理地址帧。

In our project we allocate huge pages(contiguous and unswappad memory) and we use third party API's(intel DPDK) for creating/attaching shared memory(from huge pages). 在我们的项目中,我们分配了巨大的页面(连续和不交换内存),并且我们使用了第三方API(intel DPDK)来创建/附加共享内存(从巨大的页面)。 I have observed virtual address for accessing the huge pages is same in all the processes. 我观察到在所有过程中用于访问大型页面的虚拟地址都是相同的。

is it possible?I am curious to know how is that possible? 我很好奇这怎么可能吗?

if you just want to know that same virtual address from two processes can be mapped to same physical page then answer is yes. 如果您只是想知道可以将来自两个进程的相同虚拟地址映射到同一物理页面,则答案是肯定的。 There is nothing wrong in this situation. 在这种情况下没有错。 But if on creating shared pages, you always get same addresses for all processes who are sharing the physical page, it is unique but as you said you are using some API then it is related with that API functionality(your how part of question). 但是,如果在创建共享页面时,共享物理页面的所有进程始终获得相同的地址,那么它是唯一的,但是正如您所说的,您使用的是某些API,那么它与该API功能相关(您的问题部分)。 If you are dead sure that this is the case then in my view it is a vulnerability which can be exploited. 如果您确定确实如此,那么在我看来,这是一个可以利用的漏洞。 you should consult with relevant authorities/experts to convey your findings. 您应咨询相关当局/专家以传达您的发现。

The two proccesses have the same virtual address!It's right !After mapping virtual address and physical address, master process writes the mapping information to a file; 这两个过程具有相同的虚拟地址!对!在映射虚拟地址和物理地址之后,主进程将映射信息写入文件; Slave process read the file and do the same mapping ! 从站进程读取文件并执行相同的映射!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在linux中保留物理地址空间 - Reserve a physical address space in linux 如何将 map 两个虚拟地址放在同一个物理地址 memory 上 linux? - How to map two virtual adresses on the same physical memory on linux? 内核如何知道物理页面是由两个不同的进程共享的? - How does kernel know about physical pages are shared by two different processes? 判断Linux上的MAC地址是物理地址还是虚拟地址 - Determine whether MAC address is physical or virtual on Linux 将物理地址映射到虚拟地址linux - Mapping physical addresses to virtual address linux 虚拟地址到物理地址并在android linux内核中反转 - Virtual address to physical address and reverse in android linux kernel Linux中是否有用于从虚拟地址确定物理地址的API? - Is there any API for determining the physical address from virtual address in Linux? Linux (Ubuntu), C 语言:虚拟到物理地址转换 - Linux (Ubuntu), C language: Virtual to Physical Address Translation 为什么内核映射到与进程相同的地址空间? - Why is kernel mapped to the same address space as processes? 在Linux中将物理地址转换为虚拟地址并读取其内容 - Convert physical address to virtual in Linux and read its content
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM