{"id":374104,"date":"2024-05-21T05:52:10","date_gmt":"2024-05-21T05:52:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=374104"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=374104","title":{"rendered":"<span>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u041e\u0421 Linux. \u0421\u0431\u043e\u0440 \u0434\u0430\u043c\u043f\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b82\/d9e\/1be\/b82d9e1bee3525c299726ee1553aa62f.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b82\/d9e\/1be\/b82d9e1bee3525c299726ee1553aa62f.png\"\/><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0415\u0432\u0433\u0435\u043d\u0438\u0439 \u0411\u0438\u0440\u0438\u0447\u0435\u0432\u0441\u043a\u0438\u0439, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0432 Positive Technologies \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0433\u043e \u041f\u041e.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0412\u041f\u041e \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041d\u043e \u043a\u0430\u043a \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0431\u0435\u0437 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430? \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0446\u0435\u043b\u044c \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 Linux \u0438 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0441\u0442\u0430\u0440\u043e\u0439 \u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430 \u041e\u0421.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043d\u044f\u0442\u0438\u044f \u0434\u0430\u043c\u043f\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 \u0441\u0432\u044f\u0437\u043a\u0438 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 <a href=\"https:\/\/wiki.xenproject.org\/wiki\/Xen_Project_Software_Overview\">Xen<\/a> \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/drakvuf.com\/\">DRAKVUF<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d?<\/h4>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B0%D0%BC%D0%BF_%D0%BF%D0%B0%D0%BC%D1%8F%D1%82%D0%B8\">\u0414\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438<\/a> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u043d\u0443\u0442\u0440\u0438, \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u043f\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u0412 Linux \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/man7.org\/linux\/man-pages\/man5\/core.5.html\">core<\/a>, \u0432 Windows \u2014 <a href=\"https:\/\/github.com\/libyal\/libmdmp\/blob\/main\/documentation\/Minidump%20(MDMP)%20format.asciidoc\">minidump<\/a>.<\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 (\u0412\u041f\u041e) \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043e \u0438\u043b\u0438 \u043e\u0431\u0444\u0443\u0441\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0441 \u0446\u0435\u043b\u044c\u044e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u043c. \u0414\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0443 \u0438\u043b\u0438 \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044e (\u0442\u0430\u043a\u0443\u044e \u043a\u0430\u043a <a href=\"https:\/\/github.com\/upx\/upx\">UPX<\/a> \u0438\u043b\u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439). \u0415\u0441\u043b\u0438 \u0412\u041f\u041e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0434\u0430\u043c\u043f \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u00ab\u0447\u0438\u0441\u0442\u0443\u044e\u00bb \u0432\u0435\u0440\u0441\u0438\u044e \u0412\u041f\u041e \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043c\u043f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430\u043c\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/github.com\/VirusTotal\/yara\">YARA<\/a>).<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/www.virustotal.com\/gui\/file\/f22ffc07e0cc907f00fd6a4ecee09fe8411225badb2289c1bffa867a2a3bd863\">\u043e\u0431\u0440\u0430\u0437\u0435\u0446<\/a> \u0438\u0437 <a href=\"https:\/\/ulexec.github.io\/post\/2017-11-17-unpacking_a_linux_tsunami_sample\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 UPX. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0412\u041c, \u0441\u043d\u0438\u043c\u0435\u043c \u0435\u0433\u043e \u0434\u0430\u043c\u043f, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043e\u0431\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 1).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/55d\/a5f\/ac1\/55da5fac181f2dbeb9aa4c2bc94bfe68.jpg\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0423\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0412\u041f\u041e (\u0441\u0432\u0435\u0440\u0445\u0443) \u0438 \u0435\u0433\u043e \u0441\u043d\u044f\u0442\u044b\u0439 \u0434\u0430\u043c\u043f (\u0432\u043d\u0438\u0437\u0443)\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0423\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0412\u041f\u041e (\u0441\u0432\u0435\u0440\u0445\u0443) \u0438 \u0435\u0433\u043e \u0441\u043d\u044f\u0442\u044b\u0439 \u0434\u0430\u043c\u043f (\u0432\u043d\u0438\u0437\u0443)\" width=\"1917\" height=\"1702\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/55d\/a5f\/ac1\/55da5fac181f2dbeb9aa4c2bc94bfe68.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0423\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0412\u041f\u041e (\u0441\u0432\u0435\u0440\u0445\u0443) \u0438 \u0435\u0433\u043e \u0441\u043d\u044f\u0442\u044b\u0439 \u0434\u0430\u043c\u043f (\u0432\u043d\u0438\u0437\u0443)<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0434\u0430\u043c\u043f\u0435, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0446\u0430, \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u0430\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f (\u0441\u0442\u0440\u043e\u043a\u0438, \u0444\u0443\u043d\u043a\u0446\u0438\u0438), \u0430 \u0435\u0433\u043e \u0441\u043d\u044f\u0442\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0441\u0438\u043b, \u0447\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0445 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<h4>\u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u041e\u0421 Linux?<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 Linux, \u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435 \u2014 \u043a\u0430\u043a \u0438 \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041a\u0430\u043a Linux \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432 \u0446\u0435\u043b\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/habr.com\/ru\/companies\/timeweb\/articles\/804865\/\">\u0441\u0442\u0430\u0442\u044c\u044e \u00ab\u0427\u0438\u0441\u043b\u0430 \u0438 \u0431\u0430\u0439\u0442\u044b: \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 Linux?\u00bb<\/a>. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Flat_memory_model\">\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435<\/a>) \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u0445\u0435\u043c\u044b, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 2. \u0418\u0437 \u0432\u0441\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u0435\u0440\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0435. \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 \u044f\u0434\u0440\u0435 \u041e\u0421. \u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/616\/7e9\/a87\/6167e9a8779c5f5b4f814bbb7b551aae.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\" width=\"1301\" height=\"738\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/616\/7e9\/a87\/6167e9a8779c5f5b4f814bbb7b551aae.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 userspace \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <a href=\"https:\/\/docs.kernel.org\/filesystems\/proc.html\">procfs<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u044f\u0434\u0440\u0430 \u041e\u0421 \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 \/proc\/pid\/maps, \u0441\u0430\u043c\u0443 \u0436\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u00a0\u2014 \u0438\u0437 \/proc\/pid\/mem. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043a\u0430\u043a-\u0442\u043e \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430? \u041c\u043e\u0436\u043d\u043e, \u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u044f\u0434\u0440\u043e \u041e\u0421.<\/p>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u044f\u0434\u0440\u0435 Linux \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u2014 task_struct, \u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0435\u0441\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/sched.h#L743\">sched.h<\/a>. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 mm_struct, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/sched.h#L876\"><u>\u043f\u043e\u043b\u0435 mm<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">struct task_struct {     ...     struct mm_struct *mm;     ... };<\/code><\/pre>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 mm_struct \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 Linux 6.0 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D1%80%D0%B0%D1%81%D0%BD%D0%BE-%D1%87%D1%91%D1%80%D0%BD%D0%BE%D0%B5_%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE\">\u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430<\/a> (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L489\">\u043f\u043e\u043b\u0435 mm_rb<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L488\">\u043f\u043e\u043b\u0435 mmap<\/a>) \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 6.1 \u044f\u0434\u0440\u0430 Linux, \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b maple_tree, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/B-%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE\"><u>B-\u0434\u0435\u0440\u0435\u0432\u043e\u043c<\/u><\/a> (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L690\"><u>\u043f\u043e\u043b\u0435 mm_mt<\/u><\/a>). <\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L746\">\u043f\u043e\u043b\u0435 map_count<\/a>). \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 mm_types.h (\u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L673\">Kernel 6.6<\/a> \u0438 \u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L486\">Kernel 6.0<\/a>).<\/p>\n<pre><code class=\"cpp\">struct mm_struct {         ...         \/\/ Kernel 6.1+         struct maple_tree mm_mt;         ...         \/\/ Kernel 6.1-         struct vm_area_struct *mmap;        \/* list of VMAs *\/         struct rb_root mm_rb;         ...          int map_count;      \/* number of VMAs *\/ };<\/code><\/pre>\n<p><em>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u044f\u0434\u0440\u0430 \u043e\u0442 \u0441\u0442\u0430\u0440\u044b\u0445. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0434\u0430\u043b\u0435\u0435.<\/em><\/p>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u043f\u043e\u043b\u044f vm_start \u0438 vm_end \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p> \u0424\u043b\u0430\u0433\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 (\u043f\u043e\u043b\u0435 vm_flags).<\/p>\n<\/li>\n<li>\n<p> \u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0444\u0430\u0439\u043b, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u0438\u043c\u0435\u0435\u0442\u0441\u044f, \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 \u043d\u0435\u043c (\u043f\u043e\u043b\u044f vm_file \u0438 vm_pgoff).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 6.1- \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 (\u043f\u043e\u043b\u0435 vm_next).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0438\u043f\u0430 vm_area_struct. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 mm_types.h (\u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L565\">Kernel 6.6<\/a> \u0438 \u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L403\">Kernel 6.0<\/a>).<\/p>\n<pre><code class=\"cpp\">struct vm_area_struct {         ...         unsigned long vm_start;                   \/\/ Our start address within vm_mm.         unsigned long vm_end;                     \/\/ The first byte after our end address within vm_mm. *\/         ...         struct vm_area_struct *vm_next, *vm_prev; \/\/ linked list of VM areas per task, sorted by address         ...         pgprot_t vm_page_prot;                    \/\/ Access permissions of this VMA.         unsigned long vm_flags;                   \/\/ Flags, see mm.h. *\/         ...         unsigned long vm_pgoff;                   \/\/ Offset (within vm_file) in PAGE_SIZE units *\/         struct file * vm_file;                    \/\/ File we map to (can be NULL). *\/         void * vm_private_data;                   \/\/ was vm_pte (shared mem) *\/         ... };<\/code><\/pre>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043d\u043e\u0432\u044b\u0445 \u044f\u0434\u0440\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 (maple tree)?<\/h4>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430 <a href=\"https:\/\/lwn.net\/Articles\/845507\/\">LWN<\/a>, \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b\u00a0\u2014 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. <\/p>\n<p>\u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 Linux 6.1 VMA \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0432 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 (rbtree):<\/p>\n<ul>\n<li>\n<p>rbtree \u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b, \u0441 \u043d\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 (\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 rbtree \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u0445\u043e\u0434 rbtree \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0432\u0435\u0436\u0438\u0445 \u044f\u0434\u0440\u0430\u0445 \u2014 maple_tree \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443 B-\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u0435\u0435 \u0443\u0437\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e 16 \u0432 \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 \u0438\u043b\u0438 \u0434\u0435\u0441\u044f\u0442\u0438 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0443\u0437\u043b\u0430\u0445. \u041e\u0431\u0445\u043e\u0434 B-\u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043e\u0442\u043f\u0430\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0443\u0437\u043b\u044b, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0437\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043b\u043e\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0431\u0435\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 256 \u0431\u0430\u0439\u0442, \u0447\u0442\u043e \u043a\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u0441\u0442\u0440\u043e\u043a \u043a\u044d\u0448\u0430. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0443\u0437\u043b\u0435 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u043a\u044d\u0448\u0443, \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432 \u043a\u044d\u0448\u0430 \u043f\u0440\u0438 \u043e\u0431\u0445\u043e\u0434\u0435 \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u0431\u043e\u0440 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 \u0434\u043e 6.0<\/h4>\n<p>\u0412 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430 \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 3. \u0414\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 vm_area_struct \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 2.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d5e\/d3e\/55f\/d5ed3e55fa8071039f606a367c7dd2cc.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0434\u043e 6.0\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0434\u043e 6.0\" width=\"974\" height=\"1007\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5e\/d3e\/55f\/d5ed3e55fa8071039f606a367c7dd2cc.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0434\u043e 6.0<\/figcaption><\/div>\n<\/figure>\n<h4>\u0421\u0431\u043e\u0440 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 6.1<\/h4>\n<p>\u0412 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0441\u0445\u0435\u043c\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u0430\u0441\u044c. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 maple_tree \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e maple_tree \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/maple_tree.h\"><u>maple_tree.h<\/u><\/a> \u0438 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/lib\/maple_tree.c\"><u>maple_tree.c<\/u><\/a>. \u0412 \u0434\u0435\u0440\u0435\u0432\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 maple_type:<\/p>\n<pre><code class=\"cpp\">enum maple_type {         maple_dense,         maple_leaf_64,         maple_range_64,         maple_arange_64, };<\/code><\/pre>\n<p>\u042f\u0447\u0435\u0439\u043a\u0438 \u0442\u0438\u043f\u0430 maple_dense \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u042f\u0447\u0435\u0439\u043a\u0438 \u0442\u0438\u043f\u0430 maple_range_64 \u0438 maple_leaf_64 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043b\u0438\u0441\u0442\u0430\u0445 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 slot. \u041f\u043e\u043b\u0435 pivot\u00a0\u2014 \u043e\u043d\u043e \u0436\u0435 \u00ab\u043a\u043b\u044e\u0447\u0438\u00bb\u00a0\u2014 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0442\u0430\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u043e\u0432 \u043e\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:   <\/p>\n<pre><code class=\"cpp\">struct maple_range_64 {     struct maple_pnode *parent;     unsigned long pivot[MAPLE_RANGE64_SLOTS - 1];     union {         void __rcu *slot[MAPLE_RANGE64_SLOTS];         struct {             void __rcu *pad[MAPLE_RANGE64_SLOTS - 1];             struct maple_metadata meta;         };     }; };<\/code><\/pre>\n<p>\u042f\u0447\u0435\u0439\u043a\u0438 \u0442\u0438\u043f\u0430 maple_arange_64 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0445\u0440\u0430\u043d\u044f\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0432 \u043f\u043e\u043b\u0435 slot:<\/p>\n<pre><code class=\"cpp\">struct maple_arange_64 {     struct maple_pnode *parent;     unsigned long pivot[MAPLE_ARANGE64_SLOTS - 1];     void __rcu *slot[MAPLE_ARANGE64_SLOTS];     unsigned long gap[MAPLE_ARANGE64_SLOTS];     struct maple_metadata meta; };<\/code><\/pre>\n<p>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0442\u0440\u0443\u0434\u043d\u043e, \u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">#define MAPLE_RANGE64_SLOTS  16 #define MAPLE_ARANGE64_SLOTS 10<\/code><\/pre>\n<p>\u042d\u0442\u0438\u043c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u0430. <\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u043d\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f? \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0435\u0441\u0442\u044c: \u0432\u0441\u044f \u043d\u0443\u0436\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/maple_tree.h#L93\">\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f<\/a> \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u0445 (\u0430\u0434\u0440\u0435\u0441\u0430\u0445) \u044f\u0447\u0435\u0435\u043a.<\/p>\n<p><code>Non-leaf nodes store the type of the node pointed to (enum maple_type in bits 3-6), bit 2 is reserved.\u00a0 That leaves bits 0-1 unused for now.<\/code><\/p>\n<p>\u0417\u0430 \u0442\u0438\u043f \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0431\u0438\u0442\u044b \u0441 3-\u0433\u043e \u043f\u043e 6-\u0439. \u041f\u0430\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:   <\/p>\n<ul>\n<li>\n<p>\u0410\u0434\u0440\u0435\u0441 \u044f\u0447\u0435\u0439\u043a\u0438 \u0440\u0430\u0432\u0435\u043d 0xFFFF92ADD6C5681E. \u0415\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0431\u0438\u0442\u044b:<br \/>&#8230; 01101000 0<strong>0011<\/strong>110<br \/>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438\u00a0\u2014 maple_arange_64.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430 0xFFFF92ADC8A10E0C. \u0415\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0431\u0438\u0442\u044b:<br \/>&#8230; 00001110 0<strong>0001<\/strong>100<br \/>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438\u00a0\u2014 maple_leaf_64.   <\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/lib\/maple_tree.c#L208\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f<\/a> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435 Linux:<\/p>\n<pre><code class=\"cpp\">#define MAPLE_NODE_MASK 255UL  #define MAPLE_NODE_TYPE_MASK    0x0F #define MAPLE_NODE_TYPE_SHIFT   0x03  static inline enum maple_type mte_node_type(const struct maple_enode *entry) {     return ((unsigned long)entry >> MAPLE_NODE_TYPE_SHIFT) &amp;         MAPLE_NODE_TYPE_MASK; }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b. \u0418\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0434\u0435\u0440\u0435\u0432\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0430\u0445 4 \u0438 5. \u0412\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u0437 mm_struct \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c maple_tree, \u0432 \u043b\u0438\u0441\u0442\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ddf\/298\/cdf\/ddf298cdfdf454ff8561ebb3323e8f36.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0441 6.1\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0441 6.1\" width=\"974\" height=\"584\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ddf\/298\/cdf\/ddf298cdfdf454ff8561ebb3323e8f36.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0441 6.1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da7\/67a\/5a2\/da767a5a257519794dc38c033969ee6f.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b maple_tree\" title=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b maple_tree\" width=\"974\" height=\"591\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da7\/67a\/5a2\/da767a5a257519794dc38c033969ee6f.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b maple_tree<\/figcaption><\/div>\n<\/figure>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Xen \u0438 DRAKVUF<\/h4>\n<p><strong>\u041a\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/strong><\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u0413\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044f\u0434\u0435\u0440\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0443 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u041e\u0421 \u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/wiki.xenproject.org\/wiki\/Xen_Project_Software_Overview\">Xen<\/a>. <a href=\"https:\/\/drakvuf.com\/\">DRAKVUF<\/a>\u00a0\u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e \u0442\u0438\u043f\u0443 \u00ab\u0447\u0435\u0440\u043d\u043e\u0433\u043e \u044f\u0449\u0438\u043a\u0430\u00bb, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. DRAKVUF \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u043e\u043c \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. <\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u0430\u043b\u0435\u0435 \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u0441\u0431\u043e\u0440 \u0434\u0430\u043c\u043f\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/em><\/p>\n<\/div>\n<\/details>\n<p>\u0421 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u041d\u0430 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u043e \u0432\u0441\u0435\u0439 \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0441\u043f\u0438\u0441\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">std::vector&lt;vm_area_info> procdump_linux::get_vmas_from_list(drakvuf_t drakvuf, vmi_instance_t vmi, proc_data_t process_data, uint64_t* file_offset) {     uint32_t map_count = 0;     addr_t active_mm = 0;     addr_t vm_area = 0;      ACCESS_CONTEXT(ctx,         .translate_mechanism = VMI_TM_PROCESS_PID,         .pid = process_data.pid,         .addr = process_data.base_addr + this->offsets[TASK_STRUCT_ACTIVE_MM]);      if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;active_mm))     ...     ctx.addr = active_mm + this->offsets[MM_STRUCT_MAP_COUNT];     if (VMI_FAILURE == vmi_read_32(vmi, &amp;ctx, &amp;map_count))     ...     ctx.addr = active_mm + this->list_offsets[MM_STRUCT_MMAP];     if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;vm_area))     ...     std::vector&lt;vm_area_info> vma_list;     vma_list.reserve(map_count);      for (uint32_t i = 0; i &lt; map_count; i++ )     {         read_vma_info(drakvuf, vmi, vm_area, process_data, vma_list, file_offset);          ctx.addr = vm_area + this->list_offsets[VM_AREA_STRUCT_VM_NEXT];         if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;vm_area))         ...     }     ...     return vma_list; }<\/code><\/pre>\n<p>\u041d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u044f\u0447\u0435\u0439\u043a\u0438. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 Linux \u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u0434\u043b\u044f DRAKVUF:<\/p>\n<pre><code class=\"cpp\">static uint64_t node_type(addr_t node_addr) {     return (node_addr >> MAPLE_NODE_TYPE_SHIFT) &amp; MAPLE_NODE_TYPE_MASK; }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u0433\u043b\u0443\u0431\u044c \u043d\u0443\u0436\u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u044f\u0447\u0435\u0435\u043a, \u043a\u0440\u043e\u043c\u0435 \u043b\u0438\u0441\u0442\u044c\u0435\u0432, \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u0438 \u0438\u0445 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0431\u0449\u0443\u044e \u043f\u043e\u0434\u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u0430\u0434\u0440\u0435\u0441\u0430\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438, \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0441\u043a\u0438. \u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043f\u0443\u0441\u043a\u0430 \u0432\u0433\u043b\u0443\u0431\u044c:<\/p>\n<pre><code class=\"cpp\">void procdump_linux::read_range_node_impl(drakvuf_t drakvuf, vmi_instance_t vmi, addr_t node_addr, proc_data_t const&amp; process_data, std::vector&lt;vm_area_info>&amp; vma_list, int count, uint64_t offset) {     ACCESS_CONTEXT(ctx,         .translate_mechanism = VMI_TM_PROCESS_PID,         .pid = process_data.pid,         .addr = (node_addr &amp; ~MAPLE_NODE_MASK) + offset);      addr_t slot = 0;      \/\/ get all non-zero slots     for (int i = 0; i &lt; count; i++)     {         slot = 0;         if (VMI_FAILURE == vmi_read_64(vmi, &amp;ctx, &amp;slot))         ...         if (slot)         {             switch (node_type(slot))             {                 case MAPLE_ARANGE_64:                     read_arange_node(drakvuf, vmi, slot, process_data, vma_list);                     break;                 case MAPLE_RANGE_64:                     read_range_node(drakvuf, vmi, slot, process_data, vma_list);                     break;                 case MAPLE_LEAF_64:                     read_range_leafes(drakvuf, vmi, slot, process_data, vma_list);                     break;                 default:                     PRINT_DEBUG(\"[PROCDUMP] Unsupported node type\\n\");                     break;             }         }         ctx.addr += 8;     } }<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0434\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0434\u043e \u043b\u0438\u0441\u0442\u044c\u0435\u0432, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 \u043b\u0438\u0441\u0442\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0441\u043b\u043e\u0442\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 vm_area_struct. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 \u043b\u0438\u0441\u0442\u044c\u0435\u0432:<\/p>\n<pre><code class=\"cpp\">void procdump_linux::read_range_leafes(drakvuf_t drakvuf, vmi_instance_t vmi, addr_t node_addr, proc_data_t process_data, std::vector&lt;vm_area_info> &amp;vma_list, uint64_t* file_offset) {     ACCESS_CONTEXT(ctx,         .translate_mechanism = VMI_TM_PROCESS_PID,         .pid = process_data.pid,         .addr = (node_addr &amp; ~MAPLE_NODE_MASK) + this->tree_offsets[MAPLE_RANGE_SLOT]);      addr_t slot = 0;      for(int i = 0; i &lt; MAPLE_RANGE64_SLOTS; i++)     {         slot = 0;         if (VMI_FAILURE == vmi_read_64(vmi, &amp;ctx, &amp;slot))         ...         \/\/ some slots may be set to 0         \/\/ last slot sometimes filled with used slot counter         if(slot > MAPLE_RANGE64_SLOTS)         {             read_vma_info(drakvuf, vmi, slot, process_data, vma_list, file_offset);         }         ctx.addr += 8;     } }<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 maple_tree:<\/p>\n<pre><code class=\"cpp\">std::vector&lt;vm_area_info> procdump_linux::get_vmas_from_maple_tree(drakvuf_t drakvuf, vmi_instance_t vmi, proc_data_t process_data, uint64_t* file_offset) {     ACCESS_CONTEXT(ctx,         .translate_mechanism = VMI_TM_PROCESS_PID,         .pid = process_data.pid,         .addr = process_data.base_addr + this->offsets[TASK_STRUCT_ACTIVE_MM]);      uint32_t map_count = 0;     addr_t active_mm = 0;     addr_t ma_root = 0;      if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;active_mm))     ...     ctx.addr = active_mm + this->offsets[MM_STRUCT_MAP_COUNT];     if (VMI_FAILURE == vmi_read_32(vmi, &amp;ctx, &amp;map_count))     ...     ctx.addr = active_mm + this->tree_offsets[MM_STRUCT_MM_MT] + this->tree_offsets[MAPLE_TREE_MA_ROOT];     if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;ma_root))     ...     std::vector&lt;vm_area_info> vma_list;     vma_list.reserve(map_count);      \/\/ Start VMA search from maple tree root     if(node_type(ma_root) == MAPLE_ARANGE_64)         read_arange_node(drakvuf, vmi, ma_root, process_data, vma_list, file_offset);     else if(node_type(ma_root) == MAPLE_RANGE_64)         read_range_node(drakvuf, vmi, ma_root, process_data, vma_list, file_offset);     else if(node_type(ma_root) == MAPLE_LEAF_64)         read_range_leafes(drakvuf, vmi, ma_root, process_data, vma_list, file_offset);     else         return {};     ...     return vma_list; }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e \u043d\u0435\u0439 \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435 \u044f\u0434\u0435\u0440\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b vm_area_struct (\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f). \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">void procdump_linux::read_vma_info(drakvuf_t drakvuf, vmi_instance_t vmi, addr_t vm_area, proc_data_t process_data, std::vector&lt;vm_area_info> &amp;vma_list, uint64_t* file_offset) {     ACCESS_CONTEXT(ctx,         .translate_mechanism = VMI_TM_PROCESS_PID,         .pid = process_data.pid,         .addr = vm_area + this->offsets[VM_AREA_STRUCT_VM_START]);      vm_area_info info = {};     addr_t vm_file = 0;     addr_t dentry_addr = 0;     uint32_t flags = 0;      if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;info.vm_start))     ...     ctx.addr = vm_area + this->offsets[VM_AREA_STRUCT_VM_END];     if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;info.vm_end))     ...     ctx.addr = vm_area + this->offsets[VM_AREA_STRUCT_VM_FLAGS];     if (VMI_FAILURE == vmi_read_32(vmi, &amp;ctx, &amp;flags))     ...     ctx.addr = vm_area + this->offsets[VM_AREA_STRUCT_VM_FILE];     if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;vm_file))     ...     ctx.addr = vm_file + this->offsets[_FILE_F_PATH] + this->offsets[_PATH_DENTRY];     if (VMI_FAILURE == vmi_read_addr(vmi, &amp;ctx, &amp;dentry_addr))     {         dentry_addr = 0;     }      \/\/get mapped filename if file has been mapped     char* tmp = drakvuf_get_filepath_from_dentry(drakvuf, dentry_addr);     info.filename = tmp ?: \"\";     g_free(tmp);      if (!info.filename.empty())     {         ctx.addr = vm_area + this->offsets[VM_AREA_STRUCT_VM_PGOFF];         if (VMI_FAILURE == vmi_read_32(vmi, &amp;ctx, &amp;info.vm_pgoff))         ...     }     ...     vma_list.push_back(info); }<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u0430\u043c\u043f\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0438 \u0434\u0430\u043c\u043f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0430\u043c\u043f\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430:<\/p>\n<pre><code class=\"cpp\">void procdump_linux::dump_process(drakvuf_t drakvuf, std::shared_ptr&lt;linux_procdump_task_t> task) {     if (!drakvuf_get_process_data(drakvuf, task->process_base, &amp;task->process_data))     ...     auto vmi = vmi_lock_guard(drakvuf);     std::vector&lt;vm_area_info> vma_list;      if (use_maple_tree)         vma_list = get_vmas_from_maple_tree(drakvuf, vmi, task->process_data, &amp;task->note_offset);     else         vma_list = get_vmas_from_list(drakvuf, vmi, task->process_data, &amp;task->note_offset);     ...     start_copy_memory(drakvuf, vmi, task, vma_list);     ... }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<pre><code class=\"cpp\">void procdump_linux::start_copy_memory(drakvuf_t drakvuf, vmi_instance_t vmi, std::shared_ptr&lt;linux_procdump_task_t> task, std::vector&lt;vm_area_info> vma_list) {     ...     for (uint64_t i = 0; i &lt; vma_list.size(); i++)     {         read_vm(drakvuf, vmi, vma_list[i], task);     }     ... }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 <a href=\"https:\/\/github.com\/tklengyel\/drakvuf\/blob\/main\/src\/plugins\/procdump2\/linux.cpp\">DRAKVUF<\/a>.<\/p>\n<h4>\u041e \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u0430\u043c\u043f\u0430<\/h4>\n<p>\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 core, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 core?<\/p>\n<ul>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438 <a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/gcore.1.html\">gcore<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u0432 elf-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u041e\u0421 (\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c, \u0442\u0438\u043f \u041e\u0421).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p> \u0424\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (IDA, readelf, 7z \u0438 \u0434\u0440\u0443\u0433\u0438\u0445).<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445: \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u0444\u043b\u0430\u0433\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0440\u0430\u0437\u043c\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0434\u0430\u043c\u043f\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u0442\u043e\u043a\u0430\u0445, \u043e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0432 \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/llvm.org\/doxygen\/BinaryFormat_2ELF_8h_source.html\">l<u>lvm\/BinaryFormat\/ELF.h<\/u><\/a><u>.<\/u><\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0447\u0430\u0441\u0442\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b readelf \u043d\u0430 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>readelf -a procdump.0 ELF Header:   Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00   Class:                             ELF64   Data:                              2's complement, little endian   Version:                           1 (current)   OS\/ABI:                            UNIX - System V   ABI Version:                       0   Type:                              CORE (Core file)   Machine:                           Advanced Micro Devices X86-64   Version:                           0x1   Entry point address:               0x0   Start of program headers:          64 (bytes into file)   Start of section headers:          5771126 (bytes into file)   Flags:                             0x0   Size of this header:               64 (bytes)   Size of program headers:           56 (bytes)   Number of program headers:         39   Size of section headers:           64 (bytes)   Number of section headers:         41   Section header string table index: 40  Section Headers:   [Nr] Name              Type             Address           Offset        Size              EntSize          Flags  Link  Info  Align   [ 0]                   NULL             0000000000000000  00000000        0000000000000000  0000000000000000           0     0     0   [ 1] note0             NOTE             0000000000000000  005808c8        0000000000000698  0000000000000000           0     0     1   [ 2] load              PROGBITS         0000591e7b400000  000008c8        000000000000e000  0000000000000000  AX       0     0     1   [ 3] load              PROGBITS         0000591e7b60d000  0000e8c8        0000000000001000  0000000000000000   A       0     0     1   [ 4] load              PROGBITS         0000591e7b60e000  0000f8c8        0000000000001000  0000000000000000  WA       0     0     1   [ 5] load              PROGBITS         0000591e7b60f000  000108c8        0000000000023000  0000000000000000  WA       0     0     1   [ 6] load              PROGBITS         0000591e7c09e000  000338c8        0000000000021000  0000000000000000  WA       0     0     1   [ 7] load              PROGBITS         000078e4736c0000  000548c8        000000000000a000  0000000000000000  AX       0     0     1   ..................................................................     [40] .shstrtab         STRTAB           0000000000000000  00580f60        0000000000000016  0000000000000000           0     0     1 Key to Flags:   W (write), A (alloc), X (execute), M (merge), S (strings), I (info),   L (link order), O (extra OS processing required), G (group), T (TLS),   C (compressed), x (unknown), o (OS specific), E (exclude),   l (large), p (processor specific)  There are no section groups in this file.  Program Headers:   Type           Offset             VirtAddr           PhysAddr                  FileSiz            MemSiz              Flags  Align   NOTE           0x00000000005808c8 0x0000000000000000                  0x0000000000000698 0x0000000000000000         0x1   LOAD           0x00000000000008c8 0x0000591e7b400000 0x0000000000000000                  0x000000000000e000  R E    0x1   LOAD           0x000000000000e8c8 0x0000591e7b60d000 0x0000000000000000                  0x0000000000001000  R      0x1   LOAD           0x000000000000f8c8 0x0000591e7b60e000 0x0000000000000000                  0x0000000000001000  RW     0x1   LOAD           0x00000000000108c8 0x0000591e7b60f000 0x0000000000000000                  0x0000000000023000  RW     0x1   LOAD           0x00000000000338c8 0x0000591e7c09e000 0x0000000000000000                  0x0000000000021000  RW     0x1   LOAD           0x00000000000548c8 0x000078e4736c0000 0x0000000000000000                  0x000000000000a000  R E    0x1   ..................................................................  Section to Segment mapping:   Segment Sections...    00     note0    01     load    02     load    03     load    04     load   .................................................................. There is no dynamic section in this file.  There are no relocations in this file.  The decoding of unwind sections for machine type Advanced Micro Devices X86-64 is not currently supported.  No version information found in this file.  Displaying notes found at file offset 0x005808c8 with length 0x00000698:   Owner                Data size        Description   CORE                 0x00000683       NT_FILE (mapped files)     Page size: 64                  Start                 End         Page Offset     0x0000591e7b400000  0x0000591e7b40e000  0x0000000000000000         \/bin\/ping     0x0000591e7b60d000  0x0000591e7b60e000  0x000000000000d000         \/bin\/ping     0x0000591e7b60e000  0x0000591e7b60f000  0x000000000000e000         \/bin\/ping     0x000078e4736c0000  0x000078e4736ca000  0x0000000000000000         \/lib\/x86_64-linux-gnu\/libnss_files-2.24.so   .................................................................. <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0438 \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430. \u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430. <\/p>\n<p>\u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u0435\u043d. \u041e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 proof of concept \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0442\u0430\u043a \u0438 \u0412\u041f\u041e.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 core-\u0444\u0430\u0439\u043b<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0438\u0445 \u0447\u0442\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0434\u0430\u043c\u043f\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0431\u043e\u0440 \u0434\u0430\u043c\u043f\u0430 \u0432 \u0441\u044b\u0440\u043e\u043c \u0432\u0438\u0434\u0435)<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u2014 \u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/808943\/\"> https:\/\/habr.com\/ru\/articles\/808943\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0415\u0432\u0433\u0435\u043d\u0438\u0439 \u0411\u0438\u0440\u0438\u0447\u0435\u0432\u0441\u043a\u0438\u0439, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0432 Positive Technologies \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0433\u043e \u041f\u041e.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0412\u041f\u041e \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041d\u043e \u043a\u0430\u043a \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0431\u0435\u0437 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a\u0430? \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0446\u0435\u043b\u044c \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 Linux \u0438 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0441\u0442\u0430\u0440\u043e\u0439 \u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430 \u041e\u0421.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043d\u044f\u0442\u0438\u044f \u0434\u0430\u043c\u043f\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 \u0441\u0432\u044f\u0437\u043a\u0438 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 <a href=\"https:\/\/wiki.xenproject.org\/wiki\/Xen_Project_Software_Overview\">Xen<\/a> \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/drakvuf.com\/\">DRAKVUF<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d?<\/h4>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B0%D0%BC%D0%BF_%D0%BF%D0%B0%D0%BC%D1%8F%D1%82%D0%B8\">\u0414\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438<\/a> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u2014 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412\u043d\u0443\u0442\u0440\u0438, \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u043f\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u0412 Linux \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/man7.org\/linux\/man-pages\/man5\/core.5.html\">core<\/a>, \u0432 Windows \u2014 <a href=\"https:\/\/github.com\/libyal\/libmdmp\/blob\/main\/documentation\/Minidump%20(MDMP)%20format.asciidoc\">minidump<\/a>.<\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 (\u0412\u041f\u041e) \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043e \u0438\u043b\u0438 \u043e\u0431\u0444\u0443\u0441\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0441 \u0446\u0435\u043b\u044c\u044e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441\u043e\u043c. \u0414\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0443 \u0438\u043b\u0438 \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044e (\u0442\u0430\u043a\u0443\u044e \u043a\u0430\u043a <a href=\"https:\/\/github.com\/upx\/upx\">UPX<\/a> \u0438\u043b\u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439). \u0415\u0441\u043b\u0438 \u0412\u041f\u041e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0434\u0430\u043c\u043f \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u00ab\u0447\u0438\u0441\u0442\u0443\u044e\u00bb \u0432\u0435\u0440\u0441\u0438\u044e \u0412\u041f\u041e \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043c\u043f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430\u043c\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/github.com\/VirusTotal\/yara\">YARA<\/a>).<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/www.virustotal.com\/gui\/file\/f22ffc07e0cc907f00fd6a4ecee09fe8411225badb2289c1bffa867a2a3bd863\">\u043e\u0431\u0440\u0430\u0437\u0435\u0446<\/a> \u0438\u0437 <a href=\"https:\/\/ulexec.github.io\/post\/2017-11-17-unpacking_a_linux_tsunami_sample\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 UPX. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0412\u041c, \u0441\u043d\u0438\u043c\u0435\u043c \u0435\u0433\u043e \u0434\u0430\u043c\u043f, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043e\u0431\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435 (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 1).<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0423\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0412\u041f\u041e (\u0441\u0432\u0435\u0440\u0445\u0443) \u0438 \u0435\u0433\u043e \u0441\u043d\u044f\u0442\u044b\u0439 \u0434\u0430\u043c\u043f (\u0432\u043d\u0438\u0437\u0443)<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0434\u0430\u043c\u043f\u0435, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0446\u0430, \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u0430\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f (\u0441\u0442\u0440\u043e\u043a\u0438, \u0444\u0443\u043d\u043a\u0446\u0438\u0438), \u0430 \u0435\u0433\u043e \u0441\u043d\u044f\u0442\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0441\u0438\u043b, \u0447\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0445 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<h4>\u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u041e\u0421 Linux?<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 Linux, \u0430 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435 \u2014 \u043a\u0430\u043a \u0438 \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041a\u0430\u043a Linux \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432 \u0446\u0435\u043b\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/habr.com\/ru\/companies\/timeweb\/articles\/804865\/\">\u0441\u0442\u0430\u0442\u044c\u044e \u00ab\u0427\u0438\u0441\u043b\u0430 \u0438 \u0431\u0430\u0439\u0442\u044b: \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 Linux?\u00bb<\/a>. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Flat_memory_model\">\u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435<\/a>) \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u0445\u0435\u043c\u044b, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 2. \u0418\u0437 \u0432\u0441\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u0435\u0440\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0435. \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 \u044f\u0434\u0440\u0435 \u041e\u0421. \u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 userspace \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <a href=\"https:\/\/docs.kernel.org\/filesystems\/proc.html\">procfs<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u044f\u0434\u0440\u0430 \u041e\u0421 \u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 \/proc\/pid\/maps, \u0441\u0430\u043c\u0443 \u0436\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u00a0\u2014 \u0438\u0437 \/proc\/pid\/mem. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043a\u0430\u043a-\u0442\u043e \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430? \u041c\u043e\u0436\u043d\u043e, \u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u044f\u0434\u0440\u043e \u041e\u0421.<\/p>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432 \u044f\u0434\u0440\u0435 Linux \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u2014 task_struct, \u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0435\u0441\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/sched.h#L743\">sched.h<\/a>. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 mm_struct, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/sched.h#L876\"><u>\u043f\u043e\u043b\u0435 mm<\/u><\/a>:<\/p>\n<pre><code class=\"cpp\">struct task_struct {     ...     struct mm_struct *mm;     ... };<\/code><\/pre>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 mm_struct \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 Linux 6.0 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D1%80%D0%B0%D1%81%D0%BD%D0%BE-%D1%87%D1%91%D1%80%D0%BD%D0%BE%D0%B5_%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE\">\u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430<\/a> (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L489\">\u043f\u043e\u043b\u0435 mm_rb<\/a>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L488\">\u043f\u043e\u043b\u0435 mmap<\/a>) \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 6.1 \u044f\u0434\u0440\u0430 Linux, \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b maple_tree, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/B-%D0%B4%D0%B5%D1%80%D0%B5%D0%B2%D0%BE\"><u>B-\u0434\u0435\u0440\u0435\u0432\u043e\u043c<\/u><\/a> (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L690\"><u>\u043f\u043e\u043b\u0435 mm_mt<\/u><\/a>). <\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 (<a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L746\">\u043f\u043e\u043b\u0435 map_count<\/a>). \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 mm_types.h (\u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L673\">Kernel 6.6<\/a> \u0438 \u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L486\">Kernel 6.0<\/a>).<\/p>\n<pre><code class=\"cpp\">struct mm_struct {         ...         \/\/ Kernel 6.1+         struct maple_tree mm_mt;         ...         \/\/ Kernel 6.1-         struct vm_area_struct *mmap;        \/* list of VMAs *\/         struct rb_root mm_rb;         ...          int map_count;      \/* number of VMAs *\/ };<\/code><\/pre>\n<p><em>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u044f\u0434\u0440\u0430 \u043e\u0442 \u0441\u0442\u0430\u0440\u044b\u0445. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0434\u0430\u043b\u0435\u0435.<\/em><\/p>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u0430 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (\u043f\u043e\u043b\u044f vm_start \u0438 vm_end \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p> \u0424\u043b\u0430\u0433\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 (\u043f\u043e\u043b\u0435 vm_flags).<\/p>\n<\/li>\n<li>\n<p> \u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0444\u0430\u0439\u043b, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u0438\u043c\u0435\u0435\u0442\u0441\u044f, \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432 \u043d\u0435\u043c (\u043f\u043e\u043b\u044f vm_file \u0438 vm_pgoff).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 6.1- \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 (\u043f\u043e\u043b\u0435 vm_next).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0438\u043f\u0430 vm_area_struct. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 mm_types.h (\u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/mm_types.h#L565\">Kernel 6.6<\/a> \u0438 \u0434\u043b\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.0\/source\/include\/linux\/mm_types.h#L403\">Kernel 6.0<\/a>).<\/p>\n<pre><code class=\"cpp\">struct vm_area_struct {         ...         unsigned long vm_start;                   \/\/ Our start address within vm_mm.         unsigned long vm_end;                     \/\/ The first byte after our end address within vm_mm. *\/         ...         struct vm_area_struct *vm_next, *vm_prev; \/\/ linked list of VM areas per task, sorted by address         ...         pgprot_t vm_page_prot;                    \/\/ Access permissions of this VMA.         unsigned long vm_flags;                   \/\/ Flags, see mm.h. *\/         ...         unsigned long vm_pgoff;                   \/\/ Offset (within vm_file) in PAGE_SIZE units *\/         struct file * vm_file;                    \/\/ File we map to (can be NULL). *\/         void * vm_private_data;                   \/\/ was vm_pte (shared mem) *\/         ... };<\/code><\/pre>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043d\u043e\u0432\u044b\u0445 \u044f\u0434\u0440\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 (maple tree)?<\/h4>\n<p>\u0421\u0443\u0434\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430 <a href=\"https:\/\/lwn.net\/Articles\/845507\/\">LWN<\/a>, \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b\u00a0\u2014 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. <\/p>\n<p>\u0414\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 Linux 6.1 VMA \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0432 \u043a\u0440\u0430\u0441\u043d\u043e-\u0447\u0435\u0440\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 (rbtree):<\/p>\n<ul>\n<li>\n<p>rbtree \u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b, \u0441 \u043d\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 (\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 rbtree \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u0445\u043e\u0434 rbtree \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0432\u0435\u0436\u0438\u0445 \u044f\u0434\u0440\u0430\u0445 \u2014 maple_tree \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443 B-\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u0435\u0435 \u0443\u0437\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e 16 \u0432 \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 \u0438\u043b\u0438 \u0434\u0435\u0441\u044f\u0442\u0438 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0443\u0437\u043b\u0430\u0445. \u041e\u0431\u0445\u043e\u0434 B-\u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0434\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043e\u0442\u043f\u0430\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0443\u0437\u043b\u044b, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0437\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u043b\u043e\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0431\u0435\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 256 \u0431\u0430\u0439\u0442, \u0447\u0442\u043e \u043a\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u0441\u0442\u0440\u043e\u043a \u043a\u044d\u0448\u0430. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0443\u0437\u043b\u0435 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u043a\u044d\u0448\u0443, \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432 \u043a\u044d\u0448\u0430 \u043f\u0440\u0438 \u043e\u0431\u0445\u043e\u0434\u0435 \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u0431\u043e\u0440 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0434\u0440\u0430 \u0434\u043e 6.0<\/h4>\n<p>\u0412 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u044f\u0434\u0440\u0430 \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 3. \u0414\u0432\u0443\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 vm_area_struct \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 2.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u044f\u0434\u0440\u0435 \u0434\u043e 6.0<\/figcaption><\/div>\n<\/figure>\n<h4>\u0421\u0431\u043e\u0440 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 6.1<\/h4>\n<p>\u0412 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0441\u0445\u0435\u043c\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u0430\u0441\u044c. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 maple_tree \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e maple_tree \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/maple_tree.h\"><u>maple_tree.h<\/u><\/a> \u0438 <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/lib\/maple_tree.c\"><u>maple_tree.c<\/u><\/a>. \u0412 \u0434\u0435\u0440\u0435\u0432\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 maple_type:<\/p>\n<pre><code class=\"cpp\">enum maple_type {         maple_dense,         maple_leaf_64,         maple_range_64,         maple_arange_64, };<\/code><\/pre>\n<p>\u042f\u0447\u0435\u0439\u043a\u0438 \u0442\u0438\u043f\u0430 maple_dense \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u042f\u0447\u0435\u0439\u043a\u0438 \u0442\u0438\u043f\u0430 maple_range_64 \u0438 maple_leaf_64 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043b\u0438\u0441\u0442\u0430\u0445 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0438\u0441\u043a\u043e\u043c\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 slot. \u041f\u043e\u043b\u0435 pivot\u00a0\u2014 \u043e\u043d\u043e \u0436\u0435 \u00ab\u043a\u043b\u044e\u0447\u0438\u00bb\u00a0\u2014 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0442\u0430\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043c\u043f\u043e\u0432 \u043e\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:   <\/p>\n<pre><code class=\"cpp\">struct maple_range_64 {     struct maple_pnode *parent;     unsigned long pivot[MAPLE_RANGE64_SLOTS - 1];     union {         void __rcu *slot[MAPLE_RANGE64_SLOTS];         struct {             void __rcu *pad[MAPLE_RANGE64_SLOTS - 1];             struct maple_metadata meta;         };     }; };<\/code><\/pre>\n<p>\u042f\u0447\u0435\u0439\u043a\u0438 \u0442\u0438\u043f\u0430 maple_arange_64 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0445\u0440\u0430\u043d\u044f\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0432 \u043f\u043e\u043b\u0435 slot:<\/p>\n<pre><code class=\"cpp\">struct maple_arange_64 {     struct maple_pnode *parent;     unsigned long pivot[MAPLE_ARANGE64_SLOTS - 1];     void __rcu *slot[MAPLE_ARANGE64_SLOTS];     unsigned long gap[MAPLE_ARANGE64_SLOTS];     struct maple_metadata meta; };<\/code><\/pre>\n<p>\u0421\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0442\u0440\u0443\u0434\u043d\u043e, \u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">#define MAPLE_RANGE64_SLOTS  16 #define MAPLE_ARANGE64_SLOTS 10<\/code><\/pre>\n<p>\u042d\u0442\u0438\u043c \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u0430. <\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u043d\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f? \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0435\u0441\u0442\u044c: \u0432\u0441\u044f \u043d\u0443\u0436\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/include\/linux\/maple_tree.h#L93\">\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f<\/a> \u0432 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u0445 (\u0430\u0434\u0440\u0435\u0441\u0430\u0445) \u044f\u0447\u0435\u0435\u043a.<\/p>\n<p><code>Non-leaf nodes store the type of the node pointed to (enum maple_type in bits 3-6), bit 2 is reserved.\u00a0 That leaves bits 0-1 unused for now.<\/code><\/p>\n<p>\u0417\u0430 \u0442\u0438\u043f \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0431\u0438\u0442\u044b \u0441 3-\u0433\u043e \u043f\u043e 6-\u0439. \u041f\u0430\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:   <\/p>\n<ul>\n<li>\n<p>\u0410\u0434\u0440\u0435\u0441 \u044f\u0447\u0435\u0439\u043a\u0438 \u0440\u0430\u0432\u0435\u043d 0xFFFF92ADD6C5681E. \u0415\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0431\u0438\u0442\u044b:<br \/>&#8230; 01101000 0<strong>0011<\/strong>110<br \/>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438\u00a0\u2014 maple_arange_64.<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430 0xFFFF92ADC8A10E0C. \u0415\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0431\u0438\u0442\u044b:<br \/>&#8230; 00001110 0<strong>0001<\/strong>100<br \/>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438\u00a0\u2014 maple_leaf_64.   <\/p>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6\/source\/lib\/maple_tree.c#L208\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f<\/a> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435 Linux:<\/p>\n<pre><code class=\"cpp\">#define MAPLE_NODE_MASK 255UL  #define MAPLE_NODE_TYPE_MASK    0x0F #define MAPLE_NODE_TYPE_SHIFT   0x03  static inline enum maple_type mte_node_type(const struct maple_enode *entry) {     return ((unsigned long)entry >> MAPLE_NODE_TYPE_SHIFT) &amp;         MAPLE_NODE_TYPE_MASK; }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-374104","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374104","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=374104"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374104\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}