{"id":323804,"date":"2021-05-26T15:01:10","date_gmt":"2021-05-26T15:01:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323804"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323804","title":{"rendered":"\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Linux: \u043a\u0430\u043a \/proc\/self\/mem \u043f\u0438\u0448\u0435\u0442 \u0432 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0430\u043c\u044f\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/69\/kw\/tn\/69kwtnfwitxpq4q8gaosgz8ykcy.jpeg\" width=\"400\"><\/div>\n<p>  \u0421\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0443\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u0444\u0430\u0439\u043b\u0430 <code>\/proc\/*\/mem<\/code> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0433\u043e \u00ab\u043f\u0440\u043e\u0431\u0438\u0432\u043d\u043e\u0439\u00bb \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0435. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c\u0438 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0430\u043a \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e, \u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/lkml.org\/lkml\/2017\/5\/29\/541\">\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/a> \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Julia JIT \u0438\u043b\u0438 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430 rr.<\/p>\n<p>  \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b: \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438? \u0414\u043e \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u044f\u0434\u0440\u0430?<\/p>\n<p>  \u041c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u044e\u0430\u043d\u0441\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u0418\u0437\u0443\u0447\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u044f\u0434\u0440\u043e, \u0438 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u044f\u0434\u0440\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0445 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0430\u0442\u0447\u0438\u043c libc \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \/proc\/self\/mem<\/h2>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u0438\u0432\u043d\u0430\u044f \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430? \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">#include &lt;fstream&gt; #include &lt;iostream&gt; #include &lt;sys\/mman.h&gt;  \/* Write @len bytes at @ptr to @addr in this address space using  * \/proc\/self\/mem.  *\/ void memwrite(void *addr, char *ptr, size_t len) {   std::ofstream ff(&quot;\/proc\/self\/mem&quot;);   ff.seekp(reinterpret_cast&lt;size_t&gt;(addr));   ff.write(ptr, len);   ff.flush(); }  int main(int argc, char **argv) {   \/\/ Map an unwritable page. (read-only)   auto mymap =       (int *)mmap(NULL, 0x9000,                   PROT_READ, \/\/ &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; READ ONLY &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;                   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);    if (mymap == MAP_FAILED) {     std::cout &lt;&lt; &quot;FAILED\\n&quot;;     return 1;   }    std::cout &lt;&lt; &quot;Allocated PROT_READ only memory: &quot; &lt;&lt; mymap &lt;&lt; &quot;\\n&quot;;   getchar();    \/\/ Try to write to the unwritable page.   memwrite(mymap, &quot;\\x40\\x41\\x41\\x41&quot;, 4);   std::cout &lt;&lt; &quot;did mymap[0] = 0x41414140 via proc self mem..&quot;;   getchar();   std::cout &lt;&lt; &quot;mymap[0] = 0x&quot; &lt;&lt; std::hex &lt;&lt; mymap[0] &lt;&lt; &quot;\\n&quot;;   getchar();    \/\/ Try to writ to the text segment (executable code) of libc.   auto getchar_ptr = (char *)getchar;   memwrite(getchar_ptr, &quot;\\xcc&quot;, 1);    \/\/ Run the libc function whose code we modified. If the write worked,   \/\/ we will get a SIGTRAP when the 0xcc executes.   getchar(); } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c <code>\/proc\/self\/mem<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0434\u0432\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0430\u043c \u043a\u043e\u0434, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 <code>libc<\/code> (\u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getchar<\/code>). \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441: \u043a\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0431\u0430\u0439\u0442 0xcc (\u0442\u043e\u0447\u043a\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u043e\u0434 x86-64), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u044f\u0434\u0440\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 SIGTRAP. \u042d\u0442\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 libc. \u0418 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>getchar<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c SIGTRAP, \u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u044b\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439.<\/p>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9b4\/857\/2a2\/9b48572a26789ffd0724192545543261.png\"><\/div>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u041f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x41414140 \u0431\u044b\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0438 \u0441\u0447\u0438\u0442\u0430\u043d\u043e \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0442\u0447\u0438\u043d\u0433\u0430 \u043d\u0430\u0448 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b SIGTRAP \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 <code>getchar<\/code>.<\/p>\n<p>  \u041d\u0430 \u0432\u0438\u0434\u0435\u043e:<\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"60ae10b324ff09cb160cbb90\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60ae10b324ff09cb160cbb90\"><\/iframe><\/div>\n<p>  \u041c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u043f\u043d\u0451\u043c \u0433\u043b\u0443\u0431\u0436\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<h2>\u041e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>  \u041d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 x86-64 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u044f\u0434\u0440\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u044e (MMU).<\/p>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u2014 \u0431\u0438\u0442 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438, Write Protect bit (CR0.WP). \u0418\u0437 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 Intel (\u0442\u043e\u043c 3, \u0440\u0430\u0437\u0434\u0435\u043b 2.5) \u043c\u044b \u0437\u043d\u0430\u0435\u043c:<\/p>\n<blockquote><p>\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 (16-\u0439 \u0431\u0438\u0442 CR0). \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u0430, \u043e\u043d \u043d\u0435 \u0434\u0430\u0451\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430\u043c \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u0443\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0435 \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0415\u0441\u043b\u0438 \u0431\u0438\u0442 \u043f\u0443\u0441\u0442, \u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u0443\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0435 \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0438\u0442\u0430 U\/S; \u0441\u043c. \u0440\u0430\u0437\u0434\u0435\u043b 4.1.3 \u0438 4.6).<\/p><\/blockquote>\n<p>  \u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044f\u0434\u0440\u0443 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0435 \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, <strong>\u0447\u0442\u043e, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e<\/strong>.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u2014 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0441\u0443\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430, Supervisor Mode Access Prevention (SMAP) (CR4.SMAP). \u041f\u043e\u043b\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u0432 \u0442\u043e\u043c\u0435 3, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 4.6, \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0435. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e SMAP \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043b\u0438\u0448\u0430\u0435\u0442 \u044f\u0434\u0440\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u043a\u0441\u043f\u043b\u043e\u0439\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0437\u043b\u043e\u0432\u0440\u0435\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0434\u0440\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0445\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u043e\u0434 \u044f\u0434\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043d\u0430\u043b\u044b (<code>copy_to_user<\/code> \u0438 \u0442.\u0434.), \u0442\u043e SMAP \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0435\u0433\u043e \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043f\u0430\u043c\u044f\u0442\u0438. \u0410 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0451\u0442 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438?<\/p>\n<p>  \u0415\u0441\u043b\u0438 CR0.WP \u043d\u0435 \u0437\u0430\u0434\u0430\u043d, \u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>\/proc\/*\/mem<\/code> \u0432 \u044f\u0434\u0440\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0441\u0446\u0435\u0440\u0435\u043c\u043e\u043d\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u0443\u044e \u043e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e CR0.WP <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.12\/source\/arch\/x86\/kernel\/head_64.S#L240\">\u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435<\/a> \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0436\u0438\u0432\u0451\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0431\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u042d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 (Copy-on-Write), \u0447\u0435\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0437\u0430\u0449\u0438\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u044f\u0434\u0440\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0431\u043e\u0435\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430 \u043f\u0440\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0431\u0438\u0442\u0435.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \/proc\/*\/mem<\/h2>\n<p>  <code>\/proc\/*\/mem<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/fs\/proc\/base.c\">fs\/proc\/base.c<\/a>.<\/p>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <code>file_operations<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/fs\/proc\/base.c#L835\">mem_rw()<\/a> \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0438\u0441\u0438. <code>mem_rw()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/mm\/memory.c#L4805\">access_remote_vm()<\/a>. \u0410 <code>access_remote_vm()<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0442 \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>get_user_pages_remote()<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/li>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>kmap()<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u044f\u0434\u0440\u0430.<\/li>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>copy_to_user_page()<\/code> \u0434\u043b\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438.<\/li>\n<\/ul>\n<p>  <strong>\u042d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u044f\u0434\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430!<\/strong> \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u044f\u0434\u0440\u0430 \u043d\u0430\u0434 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u043e\u0439\u0442\u0438 MMU, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u044f\u0434\u0440\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f CR0.WP \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0430\u043f\u043e\u0432:<\/p>\n<p>  <strong>get_user_pages_remote()<\/strong><\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 MMU \u044f\u0434\u0440\u0443 \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0431\u044b\u043b\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0442\u043e, \u0447\u0442\u043e MMU \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439. \u042d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>get_user_pages()<\/code>. \u041e\u043d\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043f\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0438\u0449\u0443\u0442 \u0444\u0440\u0435\u0439\u043c\u044b \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432.<\/p>\n<p>  \u0412\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u043b\u0430\u0433\u043e\u0432 \u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>get_user_pages()<\/code>. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0444\u043b\u0430\u0433 <code>FOLL_FORCE<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f <code>mem_rw()<\/code>. \u0424\u043b\u0430\u0433 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/mm\/gup.c#L930\">check_vma_flags<\/a> (\u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 <code>get_user_pages()<\/code>), \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043d\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a. \u00ab\u041f\u0440\u043e\u0431\u0438\u0432\u043d\u0430\u044f\u00bb \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a <code>FOLL_FORCE<\/code> (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043c\u043e\u0438):<\/p>\n<pre><code class=\"cpp\">static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) {         [...]         if (write) { \/\/ If performing a write..                 if (!(vm_flags &amp; VM_WRITE)) { \/\/ And the page is unwritable..                         if (!(gup_flags &amp; FOLL_FORCE)) \/\/ *Unless* FOLL_FORCE..                                 return -EFAULT; \/\/ Return an error         [...]         return 0; \/\/ Otherwise, proceed with lookup } <\/code><\/pre>\n<p>  <code>get_user_pages()<\/code> \u0441\u0442\u043e\u0436\u0435 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0435\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 (CoW). \u0415\u0441\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0442\u043e \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 <code>handle_mm_fault<\/code>, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u042d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <code>do_wp_page<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 <code>\/proc\/*\/mem <\/code>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u043c \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, libc, \u0442\u043e \u043e\u043d\u0438 \u0432\u0438\u0434\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>  <strong>kmap()<\/strong><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u0439\u0434\u0435\u043d \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u044f\u0434\u0440\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>kmap()<\/code>.<\/p>\n<p>  \u041d\u0430 64-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 x86 \u0432\u0441\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u044f\u0434\u0440\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>kmap()<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u0435\u043c\u0443 \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u0444\u0440\u0435\u0439\u043c\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0451\u043d \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c.<\/p>\n<p>  \u041d\u0430 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 x86 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>kmap()<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0444\u0440\u0435\u0439\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f highmem-\u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<p>  \u0412 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/arch\/x86\/mm\/init.c#L559\">\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/a> \u0438 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/include\/linux\/highmem.h#L44\">highmem<\/a>-\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v5.9-rc3\/source\/arch\/x86\/include\/asm\/pgtable_types.h#L190\">PAGE_KERNEL<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<p>  <strong>copy_to_user_page()<\/strong><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u0442\u0430\u043f \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>copy_to_user_page()<\/code>, \u043f\u043e \u0441\u0443\u0442\u0438 \u2014 memcpy. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 <code>kmap()<\/code>.<\/p>\n<h2>\u041e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f\u0434\u0440\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0435\u0439, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c. \u0417\u0430\u0442\u0435\u043c \u044f\u0434\u0440\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u0438\u0441\u0438. \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e memcpy.<\/p>\n<p>  \u041f\u043e\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f CR0.WP. <strong>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430<\/strong>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f\u0434\u0440\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p>  \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c: <strong>\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0430 \u043d\u0435 \u0441 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u043e\u043c, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u043c\u0441\u044f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/strong>. \u041d\u043e\u0442\u0430\u0446\u0438\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u043d\u0435 \u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0418\u0437\u0443\u0447\u0438\u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u00ab\u043f\u0440\u043e\u0431\u0438\u0432\u043d\u043e\u0439\u00bb \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>\/proc\/*\/mem<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u044f\u0434\u0440\u043e\u043c \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u044f\u0434\u0440\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u0434\u043e \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u044f\u0434\u0440\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438? \u0412 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u044f\u0434\u0440\u0430. \u041d\u043e \u043f\u0440\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u044b. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/559322\/\"> https:\/\/habr.com\/ru\/company\/mailru\/blog\/559322\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/69\/kw\/tn\/69kwtnfwitxpq4q8gaosgz8ykcy.jpeg\" width=\"400\"><\/div>\n<p>  \u0421\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0443\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u0444\u0430\u0439\u043b\u0430 <code>\/proc\/*\/mem<\/code> \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0433\u043e \u00ab\u043f\u0440\u043e\u0431\u0438\u0432\u043d\u043e\u0439\u00bb \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0435. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0443\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c\u0438 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0430\u043a \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e, \u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/lkml.org\/lkml\/2017\/5\/29\/541\">\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/a> \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Julia JIT \u0438\u043b\u0438 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430 rr.<\/p>\n<p>  \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b: \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438? \u0414\u043e \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u044f\u0434\u0440\u0430?<\/p>\n<p>  \u041c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u044e\u0430\u043d\u0441\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u0418\u0437\u0443\u0447\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u044f\u0434\u0440\u043e, \u0438 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u044f\u0434\u0440\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0445 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-323804","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323804"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323804\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}