\u8c37\u6b4c Chrome \u5b89\u5168\u56e2\u961f\u79f0\u5176\u4e00\u76f4\u5728\u81f4\u529b\u4e8e\u6539\u5584 Chrome \u6d4f\u89c8\u5668\u7684\u5185\u5b58\u5b89\u5168\uff1b\u8fd1\u671f\uff0c\u8be5\u56e2\u961f\u6b63\u5728\u7814\u7a76\u4f7f\u7528 heap scanning \u6280\u672f\u6765\u63d0\u9ad8 C++ \u7684\u5185\u5b58\u5b89\u5168\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u8c37\u6b4c Chrome \u5b89\u5168\u56e2\u961f\u79f0\u5176\u4e00\u76f4\u5728\u81f4\u529b\u4e8e\u6539\u5584 Chrome \u6d4f\u89c8\u5668\u7684\u5185\u5b58\u5b89\u5168\uff1b\u8fd1\u671f\uff0c\u8be5\u56e2\u961f\u6b63\u5728\u7814\u7a76\u4f7f\u7528 heap scanning \u6280\u672f\u6765\u63d0\u9ad8 C++ \u7684\u5185\u5b58\u5b89\u5168\u3002<\/p>\n
\u867d\u7136\u4ece\u5185\u5b58\u5b89\u5168\u65b9\u9762\u51fa\u53d1\uff0cRust \u5f53\u4e0b\u53ef\u80fd\u66f4\u53d7\u5927\u4f17\u559c\u7231\u3002\u4f46 Chrome \u5b89\u5168\u56e2\u961f\u8ba4\u4e3a\uff0c\u5c3d\u7ba1\u4eba\u4eec\u5bf9\u6bd4 C++ \u5177\u6709\u66f4\u5f3a\u5185\u5b58\u5b89\u5168\u4fdd\u8bc1\u7684\u5176\u4ed6\u8bed\u8a00\u6709\u5174\u8da3\uff0c\u4f46\u5728\u53ef\u9884\u89c1\u7684\u672a\u6765\uff0c\u50cf Chromium \u8fd9\u6837\u7684\u5927\u578b\u4ee3\u7801\u5e93\u5c06\u4f7f\u7528 C++\u3002\u9274\u4e8e\u6b64\uff0cChrome \u5de5\u7a0b\u5e08\u5df2\u7ecf\u627e\u5230\u4e86\u4f7f C++ \u66f4\u5b89\u5168\u7684\u65b9\u6cd5\uff0c\u4ee5\u51cf\u5c11\u7f13\u51b2\u533a\u6ea2\u51fa\u548c use-after free (UAF) \u7b49\u4e0e\u5185\u5b58\u76f8\u5173\u7684\u5b89\u5168\u6f0f\u6d1e\u3002\u6570\u636e\u8868\u660e\uff0c\u8fd9\u4e9b\u6f0f\u6d1e\u5360\u6240\u6709\u8f6f\u4ef6\u5b89\u5168\u6f0f\u6d1e\u7684 70%\u3002<\/p>\n
\r\nauto* foo = new Foo();\r\n\r\ndelete foo;\r\n\r\n\/\/ The memory location pointed to by foo is not representing\r\n\r\n\/\/ a Foo object anymore, as the object has been deleted (freed).\r\n\r\nfoo->Process();\r\n<\/pre>\n\u5982\u4e0a\u793a\u4f8b\uff0c\u5f53\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\u7684\u5185\u5b58\u88ab\u8fd4\u56de\u5230\u5e95\u5c42\u7cfb\u7edf\uff0c\u4f46\u6307\u9488\u6307\u5411\u4e00\u4e2a\u8fc7\u671f\u7684\u5bf9\u8c61\u65f6\uff0c\u5c31\u4f1a\u51fa\u73b0\u4e00\u4e2a\u88ab\u79f0\u4e3a\u60ac\u7a7a\u6307\u9488\uff08dangling pointers\uff09\u7684\u60c5\u51b5\uff0c\u901a\u8fc7\u5b83\u8fdb\u884c\u7684\u4efb\u4f55\u8bbf\u95ee\u90fd\u4f1a\u5bfc\u81f4 UAF \u8bbf\u95ee\u3002\u5728\u6700\u597d\u7684\u60c5\u51b5\u4e0b\uff0c\u6b64\u7c7b\u9519\u8bef\u4f1a\u5bfc\u81f4 well-defined \u7684\u5d29\u6e83\uff1b\u5728\u6700\u574f\u7684\u60c5\u51b5\u4e0b\uff0c\u5b83\u4eec\u4f1a\u9020\u6210\u53ef\u4ee5\u88ab\u6076\u610f\u884c\u4e3a\u8005\u5229\u7528\u7684\u7834\u574f\u3002 <\/p>\n
\u5728\u8f83\u5927\u7684\u4ee3\u7801\u5e93\u4e2d\uff0cUAF \u901a\u5e38\u5f88\u96be\u88ab\u53d1\u73b0\uff0c\u56e0\u4e3a\u5bf9\u8c61\u7684\u6240\u6709\u6743\u662f\u5728\u4e0d\u540c\u7ec4\u4ef6\u4e4b\u95f4\u8f6c\u79fb\u7684\u3002\u8fd9\u4e2a\u95ee\u9898\u975e\u5e38\u666e\u904d\uff0c\u4ee5\u81f3\u4e8e\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u5de5\u4e1a\u754c\u548c\u5b66\u672f\u754c\u90fd\u5728\u9891\u7e41\u5730\u9488\u5bf9\u5176\u63d0\u51fa\u7f13\u89e3\u7b56\u7565\u3002\u800c Chrome \u4e2d C++ \u7684\u4f7f\u7528\u4e5f\u6ca1\u6709\u4ec0\u4e48\u4e0d\u540c\uff0c\u5927\u591a\u6570\u9ad8\u4e25\u91cd\u6027\u5b89\u5168\u6f0f\u6d1e\u90fd\u662f UAF \u95ee\u9898\u3002\u8fd1\u671f\u53d1\u5e03\u7684 Chrome 102 \u4e2d\uff0c\u5c31\u4fee\u590d\u4e86\u4e00\u4e2a\u5173\u952e\u7684 UAF \u95ee\u9898\uff0c\u4e14\u516b\u4e2a\u9ad8\u5371\u6f0f\u6d1e\u4e2d\u6709\u516d\u4e2a\u662f UAF\u3002<\/p>\n
\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\uff0cChrome \u65b9\u9762\u5df2\u7ecf\u4f7f\u7528\u4e86\u5404\u79cd\u6280\u672f\u624b\u6bb5\uff1b\u5305\u62ec C++ \u667a\u80fd\u6307\u9488\uff08\u5982 MiraclePtr\uff09\u3001\u7f16\u8bd1\u5668\u4e2d\u7684\u9759\u6001\u5206\u6790\u3001\u52a8\u6001\u5de5\u5177\uff08\u5982 C++ sanitizers \uff09\u3001\u4ee3\u7801\u6a21\u7cca\u5668\uff0c\u4ee5\u53ca\u4e00\u4e2a\u540d\u4e3a Oilpan \u7684 C++ \u5783\u573e\u56de\u6536\u5668\u3002Oilpan\u3001MiraclePtr \u548c\u57fa\u4e8e\u667a\u80fd\u6307\u9488\u7684\u89e3\u51b3\u65b9\u6848\u9700\u8981\u5927\u91cf\u91c7\u7528\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u3002<\/p>\n
\u6b64\u5916\uff0c\u8c37\u6b4c\u8fd8\u63a2\u7d22\u4e86\u53e6\u4e00\u79cd\u65b9\u6cd5\uff1a\u5185\u5b58\u9694\u79bb\uff08memory quarantine\uff09\u3002\u57fa\u672c\u601d\u8def\u662f\u5c06 explicitly freed memory \u653e\u5165\u9694\u79bb\u533a\uff0c\u5e76\u4e14\u4ec5\u5728\u8fbe\u5230\u7279\u5b9a\u5b89\u5168\u6761\u4ef6\u65f6\u624d\u4f7f\u5176\u53ef\u7528\u3002Chrome \u5b89\u5168\u56e2\u961f\u5728\u535a\u6587\u4e2d\u603b\u7ed3\u4e86\u5728 Chrome \u4e2d\u5b9e\u9a8c\u9694\u79bb\u548c heap scanning \u7684\u5386\u7a0b\u3002<\/p>\n
\u5de5\u4f5c\u539f\u7406\u5728\u4e8e\uff0c\u7528\u9694\u79bb\u548c heap scanning \u4fdd\u8bc1 temporal safety \u7684\u4e3b\u8981\u601d\u60f3\u662f\u907f\u514d\u91cd\u7528\u5185\u5b58\uff0c\u76f4\u5230\u8bc1\u660e\u6ca1\u6709\u66f4\u591a\u7684\uff08\u60ac\u7a7a\u7684\uff09\u6307\u9488\u6307\u5411\u5b83\u3002\u4e3a\u4e86\u907f\u514d\u6539\u53d8 C++ \u7528\u6237\u4ee3\u7801\u6216\u5176\u8bed\u4e49\uff0c\u63d0\u4f9b new \u548c delete \u7684\u5185\u5b58\u5206\u914d\u5668\u88ab\u62e6\u622a\u3002<\/p>\n
<\/p>\n
\u5728\u8c03\u7528\u5220\u9664\u65f6\uff0c\u5185\u5b58\u5b9e\u9645\u4e0a\u88ab\u653e\u5165\u9694\u79bb\u533a\uff0c\u65e0\u6cd5\u518d\u7528\u4e8e\u5e94\u7528\u7a0b\u5e8f\u7684\u540e\u7eed\u65b0\u8c03\u7528\u3002\u201c\u5728\u67d0\u4e9b\u65f6\u5019\u89e6\u53d1\u4e86 heap scan\uff0c\u5b83\u626b\u63cf\u6574\u4e2a\u5806\uff0c\u5c31\u50cf\u5783\u573e\u56de\u6536\u5668\u4e00\u6837\uff0c\u4ee5\u67e5\u627e\u5bf9\u9694\u79bb\u5185\u5b58\u5757\u7684\u5f15\u7528\u3002\u90a3\u4e9b\u6ca1\u6709\u4ece\u5e38\u89c4\u5e94\u7528\u5185\u5b58\u4e2d\u83b7\u5f97\u5f15\u7528\u7684\u5757\u88ab\u8f6c\u79fb\u56de\u5206\u914d\u5668\uff0c\u5728\u90a3\u91cc\u5b83\u4eec\u53ef\u4ee5\u88ab\u91cd\u65b0\u7528\u4e8e\u540e\u7eed\u7684\u5206\u914d\u3002\u201d<\/p>\n
\u6839\u636e\u4ecb\u7ecd\uff0c\u8c37\u6b4c\u7684 heap scanning \u7531\u4e00\u5957\u88ab\u547d\u540d\u4e3a StarScan\uff08\u7b80\u79f0\u4e3a *Scan\uff09\u7684\u7b97\u6cd5\u7ec4\u6210\u3002\u4ed6\u4eec\u5c06 *Scan \u5e94\u7528\u4e8e\u6e32\u67d3\u5668\u8fdb\u7a0b\u7684\u975e\u6258\u7ba1\u90e8\u5206\uff0c\u4f7f\u7528 Speedometer2 \u8bc4\u4f30\u6027\u80fd\u5f71\u54cd\uff0c\u5e76\u5c1d\u8bd5\u4e86\u4e0d\u540c\u7248\u672c\u7684 *Scan\u3002<\/p>\n
<\/p>\n
\u6d4b\u8bd5\u7ed3\u679c\u8868\u660e\uff0c*Scan \u7684\u4e00\u4e2a\u57fa\u7840\u7248\u672c\u9020\u6210\u4e86 8% \u7684\u5185\u5b58\u56de\u5f52\u3002\u201c\u6240\u6709\u8fd9\u4e9b\u5f00\u9500\u4ece\u4f55\u800c\u6765\uff1f\u4e0d\u51fa\u6240\u6599\uff0cheap scanning \u6781\u5176\u53d7 memory bound \u5f71\u54cd\uff0c\u56e0\u4e3a\u626b\u63cf\u7ebf\u7a0b\u5fc5\u987b\u904d\u5386\u548c\u68c0\u67e5\u6574\u4e2a\u7528\u6237\u5185\u5b58\u7684\u5f15\u7528\u201d\u3002\u5728\u8fdb\u884c\u4e86\u591a\u65b9\u9762\u4f18\u5316\u4e4b\u540e\uff0cSpeedometer2 \u56de\u5f52\u4ece 8% \u964d\u4f4e\u5230\u4e86 2%\u3002\u6b64\u5916\uff0c\u6709\u5173\u5185\u5b58\u6d88\u8017\u7684\u6d4b\u91cf\u7ed3\u679c\u5219\u8868\u660e\uff0c\u6e32\u67d3\u8fdb\u7a0b\u4e2d\u7684\u626b\u63cf\u4f7f\u5185\u5b58\u6d88\u8017\u51cf\u5c11\u7ea6 12%\u3002<\/p>\n
MTE\uff08\u5185\u5b58\u6807\u7b7e\u6269\u5c55\uff0cMemory Tagging Extension\uff09\u662f ARM v8.5A \u67b6\u6784\u4e0a\u7684\u4e00\u4e2a\u65b0\u6269\u5c55\uff0c\u6709\u52a9\u4e8e\u68c0\u6d4b\u8f6f\u4ef6\u5185\u5b58\u4f7f\u7528\u4e2d\u7684\u9519\u8bef\uff1b\u8fd9\u4e9b\u9519\u8bef\u53ef\u4ee5\u662f spatial errors\uff08\u5982 out-of-bounds accesses\uff09\uff0c\u4e5f\u53ef\u4ee5\u662f temporal errors\uff08use-after-free\uff09\u3002\u8c37\u6b4c\u65b9\u9762\u83b7\u5f97\u4e86\u4e00\u4e9b\u652f\u6301 MTE \u7684 actual hardware\uff0c\u5e76\u5728\u6e32\u67d3\u5668\u8fc7\u7a0b\u4e2d\u91cd\u65b0\u8fdb\u884c\u4e86\u5b9e\u9a8c\u3002\u7ed3\u679c\u8868\u660e\uff0c\u867d\u7136 MTE \u548c memory zeroing \u4f1a\u5e26\u6765\u4e00\u4e9b\u6210\u672c\uff0c\u4f46 Speedometer2 \u4e2d\u7684\u5185\u5b58\u56de\u5f52\u7ea6\u4e3a 2%\u3002\u5b9e\u9a8c\u8fd8\u8868\u660e\uff0c\u5728 MTE \u4e4b\u4e0a\u6dfb\u52a0 *Scan \u6ca1\u6709\u53ef\u8861\u91cf\u7684\u6210\u672c\u3002 <\/p>\n
<\/p>\n
Chrome \u5b89\u5168\u56e2\u961f\u6700\u540e\u603b\u7ed3\u79f0\uff0cC++ \u53ef\u4ee5\u7f16\u5199\u51fa\u9ad8\u6027\u80fd\u5e94\u7528\u7a0b\u5e8f\uff0c\u4f46\u9700\u8981\u4ed8\u51fa\u5b89\u5168\u6027\u65b9\u9762\u7684\u4ee3\u4ef7\u3002Hardware memory tagging \u53ef\u4ee5\u4fee\u590d C++ \u7684\u4e00\u4e9b\u5b89\u5168\u7f3a\u9677\uff0c\u540c\u65f6\u4fdd\u6301\u9ad8\u6027\u80fd\u3002\u201c\u6211\u4eec\u671f\u5f85\u5728\u672a\u6765\u770b\u5230\u66f4\u5e7f\u6cdb\u5730\u91c7\u7528 Hardware memory tagging\uff0c\u5e76\u5efa\u8bae\u5728 Hardware memory tagging \u4e4b\u4e0a\u4f7f\u7528 *Scan \u6765\u4fee\u590d C++ \u7684 temporary memory safety\u3002\u4f7f\u7528\u7684 MTE \u786c\u4ef6\u548c *Scan \u7684\u5b9e\u73b0\u90fd\u662f prototypes\uff0c\u6211\u4eec\u9884\u8ba1\u4ecd\u6709\u6027\u80fd\u4f18\u5316\u7684\u7a7a\u95f4\u3002\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"
\u8c37\u6b4c Chrome \u5b89\u5168\u56e2\u961f\u79f0\u5176\u4e00\u76f4\u5728\u81f4\u529b\u4e8e\u6539\u5584 Chrome \u6d4f\u89c8\u5668\u7684\u5185\u5b58\u5b89\u5168\uff1b\u8fd1\u671f\uff0c\u8be5\u56e2\u961f\u6b63\u5728\u7814\u7a76\u4f7f\u7528 h […]<\/p>\n","protected":false},"author":1898,"featured_media":244247,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[622],"class_list":["post-244242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-chrome"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=244242"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244242\/revisions"}],"predecessor-version":[{"id":244960,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244242\/revisions\/244960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/244247"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=244242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=244242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=244242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}