【问题标题】:Why is it necessary to zeroing the contents when mmap anonymously?为什么在匿名 mmap 时需要将内容归零?
【发布时间】:2016-08-11 11:49:58
【问题描述】:

http://man7.org/linux/man-pages/man2/mmap.2.html

MAP_ANONYMOUS
              The mapping is not backed by any file; its contents are
              initialized to zero. 

为什么需要将内容初始化为零?我认为这可能相当昂贵。

【问题讨论】:

    标签: linux mmap


    【解决方案1】:

    新分配的页面用零填充,以避免敏感信息从其他进程泄漏。例如,这些进程可能已经在其中存储了密码,如果该内存没有被覆盖,则其内容会泄漏到其他地方。

    【讨论】:

      猜你喜欢
      • 2013-07-06
      • 1970-01-01
      • 2022-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-11
      相关资源
      最近更新 更多