{"id":1042,"date":"2016-07-22T02:35:36","date_gmt":"2016-07-22T02:35:36","guid":{"rendered":"http:\/\/www.inforsec.org\/wp\/?p=1042"},"modified":"2016-07-22T02:35:50","modified_gmt":"2016-07-22T02:35:50","slug":"%e5%9f%ba%e4%ba%8e%e8%87%aa%e9%80%82%e5%ba%94%e7%83%ad%e8%a1%a5%e4%b8%81%e7%9a%84android%e5%86%85%e6%a0%b8%e6%bc%8f%e6%b4%9e%e7%94%9f%e6%80%81%e4%bf%ae%e5%a4%8d%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"http:\/\/202.112.238.40\/wp\/?p=1042","title":{"rendered":"\u57fa\u4e8e\u81ea\u9002\u5e94\u70ed\u8865\u4e01\u7684Android\u5185\u6838\u6f0f\u6d1e\u751f\u6001\u4fee\u590d\u65b9\u6848"},"content":{"rendered":"<p>\u4f5c\u8005\uff1a\u5f20\u715c\u9f99 \u00a0 \u9648\u8d8a \u00a0\u5305\u6c89\u6d6e \u00a0\u590f\u826f\u948a \u00a0\u90d1\u9f99\u65e5\u00a0\u00a0\u5362\u6c38\u5f3a\u00a0 \u00a0\u97e6\u97ec\uff08Baidu X-Lab\uff09<\/p>\n<p style=\"text-align: left;\"><strong>1. \u80cc\u666f<\/strong><\/p>\n<p style=\"text-align: left;\">Android\u5185\u6838\u6f0f\u6d1e\u4e25\u91cd\u5f71\u54cd\u4e86Android\u5e73\u53f0\u7684\u5b89\u5168\u3002\u4e00\u65e6\u5185\u6838\u88ab\u653b\u7834\uff0c\u6240\u6709\u4f9d\u8d56\u5185\u6838\u5b8c\u6574\u6027\u7684\u5b89\u5168\u673a\u5236\u90fd\u5c8c\u5c8c\u53ef\u5371\uff08\u6bd4\u5982\u52a0\u5bc6\u3001\u8fdb\u7a0b\u9694\u79bb\u3001\u652f\u4ed8\u3001\u6307\u7eb9\u9a8c\u8bc1\u7b49\uff09\u3002\u4f5c\u4e3aAndroid\u5e73\u53f0\u6700\u540e\u7684\u9632\u7ebf\uff0cTrustZone\u4e5f\u4f1a\u53d7\u5230\u5a01\u80c1\uff0c\u56e0\u4e3a\u5185\u6838\u53ef\u4ee5\u4ece\u5f88\u591a\u88ab\u4fe1\u4efb\u7684\u63a5\u53e3\u5411TrustZone\u53d1\u8d77\u653b\u51fb\u3002\u56e0\u6b64\uff0c\u7406\u60f3\u60c5\u51b5\u4e0bAndroid\u751f\u6001\u5708\u5e94\u8be5\u53ca\u65f6\u6d88\u706d\u5185\u6838\u6f0f\u6d1e\u3002\u7136\u800c\u4eceGoogle\u7684Android Security Bulletin\u4e0a\u770b\uff0cAndroid\u5185\u6838\u6f0f\u6d1e\u7684\u6570\u91cf\u5448\u98de\u5feb\u4e0a\u6da8\u7684\u8d8b\u52bf\uff08Figure 1\u6240\u793a\uff09\u3002\u867d\u7136\u8fd9\u4ee3\u8868\u7740\u4eba\u4eec\u5bf9\u5185\u6838\u5b89\u5168\u7684\u6295\u5165\u9010\u6e10\u589e\u5927\uff0c\u4f46\u4e0e\u6b64\u540c\u65f6\u8fd9\u4e9b\u6f0f\u6d1e\u4e00\u65e6\u516c\u8bf8\u4e8e\u4f17\uff0c\u5728\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\u90fd\u96be\u4ee5\u5f97\u5230\u4fee\u590d\uff0c\u5bfc\u81f4\u8d8a\u6765\u8d8a\u591a\u7684\u53ef\u4ee5\u516c\u5f00\u5229\u7528\u7684\u6f0f\u6d1e\u53d8\u6210\u4e86\u9ed1\u4ea7\u624b\u4e2d\u7684\u5229\u5668\u3002\u7eb5\u89c2\u8fd1\u671f\u51e0\u8d77\u5f71\u54cd\u5168\u4e16\u754c\u7684\u91cd\u5927\u6076\u610fmalware\u4e8b\u4ef6[1-4]\uff0c\u5b83\u4eec\u90fd\u643a\u5e26\u4e86root\u5de5\u5177\uff0c\u5e76\u4e14root\u7684\u65b9\u6cd5\u4e0d\u662f\u6e90\u81ea\u516c\u5f00\u7684PoC\uff0c\u5c31\u662f\u76f4\u63a5\u91cd\u7528\u4e86\u4e00\u4e9b\u4e00\u952eroot\u5de5\u5177\u7684\u5e93\u3002<\/p>\n<p style=\"text-align: left;\"><!--more--><br \/>\n<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1043 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/1.png\" alt=\"1\" width=\"413\" height=\"228\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/1.png 413w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/1-300x166.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/1-250x138.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/1-360x200.png 360w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/1-150x83.png 150w\" sizes=\"auto, (max-width: 413px) 100vw, 413px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Figure 1: Number of kernel vulnerabilities disclosed in monthly Android Security Bulletin<\/p>\n<p>\u4eba\u4eec\u7ecf\u5e38\u5ba3\u79f0\u201cAndroid\u5bb9\u6613\u88ab\u653b\u51fb\u201d\u6216\u8005\u201cAndroid\u4e0d\u5982\u82f9\u679c\u5b89\u5168\u201d\u3002\u4f46\u662f\uff0cTable 1\u5217\u51fa\u4e86\u51e0\u4e4e\u540c\u65f6\u671fiOS\u548cAndroid\u5185\u6838\u6f0f\u6d1e\u6570\u91cf\u7684\u6bd4\u8f83\uff0c\u4e0d\u96be\u53d1\u73b0Android\u6f0f\u6d1e\u516c\u5e03\u7684\u9891\u7387\u751a\u81f3\u4e0d\u5982iOS\u591a\u3002\u867d\u7136\u6f0f\u6d1e\u548c\u6f0f\u6d1e\u5e76\u4e0d\u80fd\u76f4\u63a5\u62ff\u6765\u6bd4\u8f83\uff08\u56e0\u4e3a\u5371\u5bb3\u7a0b\u5ea6\u4e0d\u4e00\u5b9a\u4e00\u6837\uff09\uff0c\u4f46\u81f3\u5c11\u8fd9\u53ef\u4ee5\u63d0\u4f9b\u4e00\u4e2a\u53c2\u8003\u57fa\u51c6\u2014\u2014\u81f3\u5c11\u82f9\u679c\u4e0d\u662f\u751f\u6765\u5c31\u5b89\u5168\u7684\uff0c\u800c\u4e14\u4e5f\u9700\u8981\u5b9a\u671f\u4fee\u590d\u5927\u91cf\u7684\u5185\u6838\u6f0f\u6d1e\u3002\u53ea\u662f\u56e0\u4e3aiOS\u4fee\u8865\u6f0f\u6d1e\u6bd4\u8f83\u5168\u9762\u548c\u53ca\u65f6\uff0c\u8ba9\u4eba\u611f\u89c9\u5b83\u975e\u5e38\u201c\u5b89\u5168\u201c\u3002\u540c\u6837\u5730\uff0c\u201cAndroid\u4e0d\u5b89\u5168\u201d\u5e76\u4e0d\u662f\u4ec5\u4ec5\u56e0\u4e3a\u6f0f\u6d1e\u9891\u53d1\uff0c\u66f4\u91cd\u8981\u7684\u8fd8\u662f\u4e0d\u80fd\u50cfiOS\u8fd9\u6837\u53ca\u65f6\u5730\u4fee\u590d\u95ee\u9898\u3002<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1044 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/2.png\" alt=\"2\" width=\"600\" height=\"154\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/2.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/2-300x77.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/2-250x64.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/2-150x39.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">\u3000\u3000Table 1: iOS kernel vulnerabilities disclosed in each release, compared to that of Android. Note that the number of vulnerabilities may not be directly comparable due to different threat levels. But the comparison can still provide a rough sense that iOS is not born as \u201cbullet-proof\u201d; it is more secure just because it can get timely patches in a large scale.<\/p>\n<p><strong>2. \u4e3a\u4f55Android\u5185\u6838\u6f0f\u6d1e\u5f97\u4e0d\u5230\u53ca\u65f6\u4fee\u590d\uff1f<\/strong><\/p>\n<p>\u7a76\u5176\u539f\u56e0\uff0c\u4e3b\u8981\u6709\u4e09\u70b9\uff1a\u8fc7\u957f\u7684\u8865\u4e01\u94fe\uff0c\u4e25\u91cd\u788e\u7247\u5316\u7684\u751f\u6001\uff0c\u548c\u751f\u6001\u804c\u80fd\u4e0d\u5339\u914d\u3002<\/p>\n<p>Android\u7684\u4ea7\u4e1a\u94fe\u8fc7\u957f\uff1aAndroid\u751f\u6001\u7cfb\u7edf\u4ea7\u4e1a\u94fe\u975e\u5e38\u957f\uff0c\u4ece\u786c\u4ef6\u5382\u5546\uff0c\u5230Google\uff0c\u5230\u624b\u673a\u5382\u5546\uff0c\u518d\u5230\u8fd0\u8425\u5546\u3002\u6bcf\u4e00\u4e2a\u73af\u8282\u90fd\u6709\u81ea\u5df1\u7684\u5f00\u53d1\u3001\u8d28\u63a7\u3001\u9a8c\u8bc1\u7b49\u590d\u6742\u6d41\u7a0b\uff0c\u6709\u65f6\u5019\u8fd8\u4f1a\u76f8\u4e92\u51b2\u7a81\u3002\u8fd9\u6837\u8981\u6d88\u8017\u5927\u91cf\u7684\u65f6\u95f4\u548c\u4eba\u529b\uff0c\u800c\u4e14\u6709\u65f6\u751a\u81f3\u5bfc\u81f4\u5b89\u5168\u8865\u4e01\u65e0\u6cd5\u4e0b\u53d1\u7ed9\u7528\u6237\u3002\u8fd9\u4e2a\u5197\u957f\u7684\u4fee\u8865\u94fe\u6761\u5982Figure 2\u6240\u793a\u3002<\/p>\n<p style=\"text-align: center;\">\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1045 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/3.png\" alt=\"3\" width=\"600\" height=\"400\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/3.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/3-300x200.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/3-225x150.png 225w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/3-150x100.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>Figure 2: The long patching circle of Android kernel vulnerabilities<\/p>\n<p>Android\u7cfb\u7edf\u788e\u7247\u5316\u8fc7\u4e8e\u4e25\u91cd\uff1aAndroid\u7cfb\u7edf\u7684\u788e\u7247\u5316\u662f\u6307\u4e16\u754c\u4e0a\u6240\u6709Android\u7528\u6237\u5b9e\u9645\u4f7f\u7528\u7684Android\u7248\u672c\u3001\u914d\u7f6e\u3001\u9a71\u52a8\u7b49\u7b49\u6709\u7740\u975e\u5e38\u663e\u8457\u7684\u5dee\u5f02\u3002Android\u7cfb\u7edf\u788e\u7247\u5316\u5df2\u7ecf\u6210\u4e3a\u4e86\u4e1a\u754c\u5171\u8bc6\uff0c\u7531\u4e8e\u7cfb\u7edf\u7684\u5f00\u6e90\u6027\uff0c\u7528\u6237\u3001\u5f00\u53d1\u8005\u3001OEM\u5382\u5546\u3001\u8fd0\u8425\u5546\u90fd\u53ef\u4ee5\u6309\u7167\u81ea\u5df1\u7684\u60f3\u6cd5\u8fdb\u884c\u6539\u9020\uff0c\u8fd9\u79cd\u201c\u788e\u7247\u5316\u201d\u7684\u7a0b\u5ea6\u5f02\u5e38\u4e25\u91cd\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5927\u591a\u6570\u624b\u673a\u8bbe\u5907\u5382\u5546\u5df2\u7ecf\u5931\u53bb\u4e86\u4e3a\u6240\u6709\u7528\u6237\u4f7f\u7528\u7684Android\u7cfb\u7edf\u63d0\u4f9b\u5b89\u5168\u8865\u4e01\u7684\u80fd\u529b\u3002Figure 3\u6240\u793a\u4e3a\u7e41\u591a\u7684Android\u54c1\u724c\u548c\u673a\u578b\u3002<\/p>\n<p style=\"text-align: center;\">\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1046 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/4.png\" alt=\"4\" width=\"600\" height=\"404\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/4.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/4-300x202.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/4-223x150.png 223w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/4-150x101.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>Figure 3: Android device fragmentation, cited from [5]<\/p>\n<p>\u6839\u636eGoogle\u5b98\u65b9\u53d1\u5e03\u4e8e2016\u5e747\u6708\u7684\u7edf\u8ba1[6] \uff1a<\/p>\n<p>1)Lollipop (Android 5.0) \u53d1\u5e03\u4e8eNovember 2014\uff0c \u4f46\u662f\u4ecd\u7136\u670955% \u7684\u8bbe\u5907\u4f4e\u4e8e\u8be5\u7248\u672c<\/p>\n<p>2)Google\u5df2\u7ecf\u505c\u6b62\u4e3a\u4f4e\u4e8e4.4\u7248\u672c\u7684Android\u63d0\u4f9b\u8865\u4e01\uff0c\u4f46\u4ecd\u670923%\u7684\u8bbe\u5907\u4f4e\u4e8e\u8be5\u7248\u672c<\/p>\n<p>\u800c\u5728\u4e2d\u56fd\uff0c\u7531\u4e8e\u5bf9Google\u7684\u8bbf\u95ee\u88ab\u963b\u9694\uff0c\u8fd9\u4e00\u95ee\u9898\u66f4\u52a0\u4e25\u91cd\u3002\u901a\u8fc7\u968f\u673a\u91c7\u6837\u5927\u7ea6200\u4e07\u88c5\u6709Baidu App\u7684\u8bbe\u5907\u7684\u624b\u673a\uff0c\u6211\u4eec\u53d1\u73b0\uff1a<\/p>\n<p>1)80% \u7684\u8bbe\u5907\u4f4e\u4e8eAndroid 5.0<\/p>\n<p>2)42% \u7684\u8bbe\u5907\u4f4e\u4e8eAndroid 4.4<\/p>\n<p>\u751f\u6001\u804c\u80fd\u4e0d\u5339\u914d\uff1a\u5176\u5b9e\u6700\u5bb9\u6613\u63a8\u8fdb\u4fee\u590d\u7684\u662f\u624b\u673a\u5382\u5546\uff0c\u4f46\u5927\u90e8\u5206\u624b\u673a\u5382\u5546\u81ea\u8eab\u7684\u788e\u7247\u5316\u73b0\u8c61\u975e\u5e38\u4e25\u91cd\uff0c\u5bfc\u81f4\u4e86\u624b\u673a\u5382\u5546\u6ca1\u6709\u8db3\u591f\u7684\u8d44\u6e90\u548c\u7cbe\u529b\u53bb\u4fee\u590d\u6f0f\u6d1e\u3002\u800c\u5bf9\u4e8e\u5b89\u5168\u5382\u5546\u6765\u8bb2\uff0c\u4fee\u590d\u6f0f\u6d1e\u4e5f\u662f\u4e00\u4ef6\u5f88\u5c34\u5c2c\u7684\u4e8b\u60c5\u3002\u5728\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u5b89\u5168\u5382\u5546\u662f\u6ca1\u6709\u7cfb\u7edf\u6388\u6743\u7684\uff0c\u9664\u975e\u5148\u8fdb\u884croot\u3002\u5373\u4f7froot\uff0c\u5b89\u5168\u5382\u5546\u4ecd\u7136\u8981\u9762\u4e34\u4e0d\u540c\u624b\u673a\u54c1\u724c\u66f4\u52a0\u4e25\u91cd\u7684\u788e\u7247\u5316\u6311\u6218\u3002<\/p>\n<p><strong>3. \u6848\u4f8b\u5206\u6790<\/strong><\/p>\n<p>\u5177\u4f53\u770b3\u4e2a\u8457\u540d\u7684\u80fd\u88ab\u7528\u6765\u8fdb\u884c\u8de8\u5e73\u53f0root\u7684\u6f0f\u6d1e\uff1a\u7b2c\u4e00\u4e2a\u662fCVE-2014-3153\uff08\u201cTowelroot\u201d\uff09\uff0c\u516c\u5f00\u548c\u4fee\u8865\u65f6\u95f4\u4e3aJune 3, 2014 [7] \uff1b\u7b2c\u4e8c\u4e2a\u662fCVE-2015-3636\uff08\u201cPing Pong Root\u201d\uff09\uff0c\u516c\u5f00\u548c\u4fee\u8865\u65f6\u95f4\u4e3a September 9, 2015 [8] \uff1b\u7b2c\u4e09\u4e2a\u662fCVE-2015-1805\uff0c\u516c\u5f00\u65f6\u95f4\u4e3aApril 3, 2014 [9] \uff0c\u4f46\u76f4\u5230March 18, 2016\u624d\u5728Android\u5e73\u53f0\u4e0a\u4fee\u590d [10] \u3002Figure 4 \u6240\u793a\u4e3a\u8fd9\u4e09\u4e2a\u6f0f\u6d1e\u8ddd\u4eca\uff082016\u5e747\u6708\uff09\u7684\u65f6\u95f4\u8de8\u5ea6\u3002\u5176\u4e2d\u6700\u77ed\u7684\u4e5f\u8fbe\u5230\u4e86120\u5929\u3002<\/p>\n<p style=\"text-align: center;\">\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1047 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/5.png\" alt=\"5\" width=\"451\" height=\"206\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/5.png 451w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/5-300x137.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/5-250x114.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/5-150x69.png 150w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/a>\u3000Figure 4: Days from advisory publication date to now (July 2016) for the three famous &#8220;one-to-root-all&#8221; kernel vulnerabilities<\/p>\n<p style=\"text-align: left;\"><a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1048 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/6.png\" alt=\"6\" width=\"391\" height=\"215\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/6.png 391w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/6-300x165.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/6-250x137.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/6-150x82.png 150w\" sizes=\"auto, (max-width: 391px) 100vw, 391px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Figure 5: Vulnerability statistics collected from Chinese Android device<\/p>\n<p style=\"text-align: left;\">Figure 5 \u6240\u793a\u4e3a\u8fd9\u4e09\u4e2a\u6f0f\u6d1e\u5728\u88c5\u6709\u767e\u5ea6App\u7684\u624b\u673a\u4e0a\u7684\u968f\u673a\u91c7\u6837\u7ed3\u679c\u3002\u53ef\u89c1\u867d\u7136\u8fd9\u4e48\u957f\u65f6\u95f4\u8fc7\u53bb\u4e86\uff0c\u4ecd\u7136\u6709\u975e\u5e38\u591a\u7684\u8bbe\u5907\u6ca1\u6709\u5f97\u5230\u6f0f\u6d1e\u4fee\u590d\u3002<\/p>\n<p><strong>4. AdaptKpatch: \u81ea\u9002\u5e94\u5185\u6838\u70ed\u4fee\u8865\u6846\u67b6<\/strong><\/p>\n<p>\u5982\u4f55\u89e3\u51b3Android\u6f0f\u6d1e\u5f97\u4e0d\u5230\u53ca\u65f6\u4fee\u8865\u7684\u95ee\u9898\uff1f\u5bf9\u4e8e\u8df3\u8fc7\u5197\u957f\u8865\u4e01\u94fe\u8fd9\u4e2a\u95ee\u9898\uff0c\u5b66\u672f\u754c\u5de5\u4e1a\u754c\u5df2\u7ecf\u7ed9\u51fa\u4e86\u4e00\u4e9b\u65b9\u6848\uff0c\u6bd4\u5982kpatch [11] , ksplice [12] , kGraft [13] , \u4ee5\u53caLinux upstream\u7684livepatch [14] . \u4f46\u662f\u8fd9\u4e9b\u65b9\u6848\u5e76\u6ca1\u6709\u89e3\u51b3\u788e\u7247\u5316\u548c\u80fd\u529b\u5931\u914d\u7684\u95ee\u9898\u3002\u66f4\u672c\u8d28\u5730\u8bf4\uff0c\u8fd9\u4e9b\u65b9\u6848\u90fd\u4f9d\u8d56\u6e90\u7801\uff0c\u5bf9\u4e8e\u6ca1\u6709\u6e90\u7801\u7684\u7b2c\u4e09\u65b9\u4e0d\u9002\u7528\uff0c\u66f4\u9051\u8bba\u8865\u4e01\u7684\u5e7f\u6cdb\u9002\u914d\u3002\u56e0\u6b64\u5728\u7b2c\u4e03\u5c4aHITB \u4f1a\u8bae\u4e0a[15] , \u6211\u4eec\u63d0\u51fa\u4e86\u5185\u6838\u81ea\u9002\u914d\u4fee\u8865\u7684\u65b9\u6848\uff0c\u79f0\u4f5cAdaptKpatch\u3002\u5176\u5927\u81f4\u6d41\u7a0b\u5982Figure 6\u6240\u793a\u3002<\/p>\n<p style=\"text-align: center;\">\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1049 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/7.png\" alt=\"7\" width=\"600\" height=\"336\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/7.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/7-300x168.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/7-250x140.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/7-150x84.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>Figure 6: Adaptive kernel live patching procedures without phone vendors\u2019 cooperation [15]<\/p>\n<p>\u7b80\u5355\u6765\u8bf4\uff0c\u8be5\u6846\u67b6\u5728\u624b\u673a\u4e0a\u63a2\u6d4b\u5b58\u5728\u7684\u5185\u6838\u6f0f\u6d1e\uff0c\u5411\u7528\u6237\u5f81\u8be2\u662f\u5426\u4fee\u590d\u3002\u5f97\u5230\u5141\u8bb8\u540e\uff0c\u8be5\u6846\u67b6root\u624b\u673a\u5e76\u6536\u96c6\u5fc5\u8981\u7684\u4fe1\u606f\uff0c\u5305\u62eckernel versions, symbol addresses, symbol CRCs\u7b49\u3002\u53d6\u51b3\u4e8e\u8bbe\u5907\u662f\u5426\u63d0\u4f9binsmod\u6216\u8005(k)mem \u8bbe\u5907\uff0c\u6846\u67b6\u4f1a\u4e0b\u8f7d\u5bf9\u5e94\u7684\u6a21\u677f\u8fdb\u884c\u6570\u636e\u7ed3\u6784\u586b\u5145\u548csymbol\u89e3\u6790\uff0c\u5e76\u89c6\u60c5\u51b5\u5bf9\u5185\u6838\u7684\u4e00\u4e9b\u52a8\u6001\u6821\u9a8c\u673a\u5236\u8fdb\u884c\u653e\u5bbd\u3002\u8fd9\u4e9b\u6b65\u9aa4\u5b8c\u6210\u540e\u5373\u5b8c\u6210\u8865\u4e01\u6a21\u677f\u7684\u9002\u914d\uff0c\u6240\u751f\u6210\u7684\u8865\u4e01\u5373\u53ef\u63d2\u5165\u8be5\u8bbe\u5907\u7684\u5185\u6838\u6267\u884c\u4fee\u8865\u64cd\u4f5c\u3002\u5177\u4f53\u7684\u4fee\u8865\u64cd\u4f5c\u548c\u5176\u4ed6\u70ed\u4fee\u8865\u65b9\u6848\u65e0\u5f02\uff0c\u6bd4\u5982\u51fd\u6570\u66ff\u6362\u3001\u8c03\u7528\u66ff\u6362\u3001\u539f\u5730\u4fee\u8865\u7b49\uff0c\u6b64\u5904\u4e0d\u518d\u8d58\u8ff0\u3002 \u6ce8\u610f\u8be5\u6846\u67b6\u53ea\u662f\u70ed\u4fee\u590d\uff0c\u56e0\u6b64\u6bcf\u6b21\u91cd\u542f\u90fd\u8981\u91cd\u65b0\u52a0\u8f7d\u70ed\u8865\u4e01\u3002\u5982\u679c\u67d0\u6b21\u542f\u52a8\u53d1\u73b0\u524d\u6b21\u542f\u52a8\u56e0\u4e3a\u70ed\u8865\u4e01\u800c\u51fa\u73b0\u5d29\u6e83\uff0c\u5219\u653e\u5f03\u52a0\u8f7d\u70ed\u8865\u4e01\u56de\u6eda\u5230\u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<p style=\"text-align: center;\">\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1050 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/8.png\" alt=\"8\" width=\"600\" height=\"295\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/8.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/8-300x148.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/8-250x123.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/8-150x74.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>Figure 7: Adaptive kernel live patching framework with phone vendor&#8217;s cooperation<\/p>\n<p>\u5982\u679c\u624b\u673a\u5382\u5546\u613f\u610f\u548c\u7b2c\u4e09\u65b9\u534f\u4f5c\u4fee\u590d\u65f6\uff0c\u8be5\u6846\u67b6\u53ef\u4ee5\u6700\u5927\u5316\u53d1\u6325\u6548\u76ca\u3002\u5382\u5546\u4e0d\u518d\u9700\u8981\u82b1\u8d44\u6e90\u548c\u7cbe\u529b\u4fee\u8865\u6f0f\u6d1e\uff0c\u53ea\u9700\u8981\u63d0\u4f9b\u9884\u5236\u7684\u5185\u6838\u4fee\u8865\u673a\u5236\/\u80fd\u529b\uff0c\u800c\u5b89\u5168\u5382\u5546\u4e0d\u9700\u8981\u518droot\u624b\u673a\u548c\u63a2\u6d4b\u6f0f\u6d1e\uff0c\u53ef\u4ee5\u4e13\u6ce8\u5728\u4fee\u8865\u6f0f\u6d1e\u4e0a\u3002\u8fd9\u4e00\u5408\u4f5c\u6a21\u5f0f\u5982Figure 7\u6240\u793a\u3002\u57fa\u4e8e\u8fd9\u4e00\u5408\u4f5c\u8054\u76df\uff0c\u53ef\u6709\u5982\u4e0b\u5b89\u5168\u673a\u5236\u4fdd\u8bc1\u8865\u4e01\u7684\u5b89\u5168\uff1a<\/p>\n<p>1)\u5382\u5546\u8d44\u8d28\u6821\u9a8c\uff1a\u53ea\u6709\u6709\u80fd\u529b\u548c\u540d\u58f0\u597d\u7684\u5382\u5546\u65b9\u53ef\u8fdb\u5165\u5408\u4f5c\u8054\u76df\uff0c\u5404\u5382\u5546\u6240\u53d1\u8865\u4e01\u9700\u7b7e\u540d\u9a8c\u8bc1\uff1b<\/p>\n<p>2)\u8865\u4e01\u5ba1\u8ba1\uff1a\u8865\u4e01\u53d1\u653e\u524d\u9700\u8981\u7ecf\u8fc7\u8054\u76df\u91cc\u522b\u7684\u5382\u5546\u8fdb\u884c\u5b89\u5168\u5ba1\u8ba1\uff0c\u9632\u6b62\u5f15\u5165\u65b0\u7684\u6f0f\u6d1e\u6216\u8005\u540e\u95e8\uff1b<\/p>\n<p>3)\u8bc4\u4ef7\u6392\u540d\uff1a\u7c7b\u4f3c\u4e8eApp Store\uff0c\u7528\u6237\u53ef\u4ee5\u5bf9\u67d0\u4e2a\u8865\u4e01\u8fdb\u884c\u7a33\u5b9a\u6027\u7b49\u65b9\u9762\u7684\u8bc4\u4ef7\u3002\u5176\u4ed6\u7528\u6237\u53ef\u4ee5\u6839\u636e\u8865\u4e01\u7684\u65e2\u6709\u8bc4\u4ef7\u9009\u62e9\u6253\u8fd8\u662f\u4e0d\u6253\u3002<\/p>\n<p><strong>5. LuaKpatch: \u66f4\u7075\u6d3b\u8fc5\u901f\uff0c\u4f46\u662f\u66f4\u4e25\u683c<\/strong><\/p>\n<p><strong>5.1 \u8bbe\u8ba1\u539f\u7406<\/strong><\/p>\n<p>AdaptKpatch\u5df2\u7ecf\u80fd\u5f88\u597d\u5730\u89e3\u51b3Android\u5185\u6838\u6f0f\u6d1e\u957f\u671f\u5f97\u4e0d\u5230\u4fee\u590d\u7684\u95ee\u9898\u4e86\uff0c\u4f46\u8865\u4e01\u4ecd\u7136\u9700\u8981\u901a\u8fc7\u5ba1\u8ba1\u624d\u80fd\u4fdd\u8bc1\u5b89\u5168\u3002\u56e0\u6b64\u6211\u4eec\u8fd8\u63d0\u51fa\u4e86\u53e6\u4e00\u4e2a\u65b9\u6848\uff1aLuaKpatch\u3002\u5176\u539f\u7406\u662f\u7528\u7c7b\u578b\u5b89\u5168\uff08type-safe\uff09\u7684\u52a8\u6001\u8bed\u8a00\u5f15\u64ce\uff08\u6bd4\u5982Lua\uff09\u6765\u6267\u884c\u8865\u4e01\u3002\u8fd9\u6837\u4e00\u6765\u8865\u4e01\u7075\u6d3b\u6613\u7ef4\u62a4\uff0c\u540c\u65f6\u5176\u6267\u884c\u53ef\u4ee5\u4e25\u683c\u63a7\u5236\u5728\u5f15\u64ce\u6240\u5141\u8bb8\u7684\u8303\u56f4\u5185\uff0c\u4e5f\u4e0d\u62c5\u5fc3\u56e0\u4e3a\u6ea2\u51fa\u3001\u7a7a\u6307\u9488\u5f15\u7528\u7b49\u95ee\u9898\u88ab\u653b\u51fb\u52ab\u6301\u3002<\/p>\n<p><a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1051 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/9.png\" alt=\"9\" width=\"600\" height=\"346\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/9.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/9-300x173.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/9-250x144.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/9-150x87.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Figure 8: Kernel functions take input from either arguments or external data reading (e.g., copy_from_user) as shown in (a). Most Android kernel exploits inject malicious input into the target function and hijack the control flow to achieve arbitrary code execution, as shown in (b). So, by hooking the data input entries and validating the input as shown in (c), we can block most of the kernel exploits.<\/p>\n<p>Figure 8 \u6240\u793a\u4e3a\u7edd\u5927\u90e8\u5206kernel\u6f0f\u6d1e\u653b\u51fb\u7684\u539f\u7406\u3002\u4e00\u822c\u800c\u8a00\u653b\u51fb\u8005\u90fd\u9700\u8981\u704c\u5165\u6076\u610f\u7684\u8f93\u5165\u6765\u5b9e\u73b0\u63a7\u5236\u6d41\u52ab\u6301\u3002\u56e0\u6b64LuaKpatch\u53ea\u9700\u8981\u5728\u51fd\u6570\u5165\u53e3\u548c\u51fd\u6570\u4e2d\u8bfb\u6570\u636e\u7684\u4f4d\u7f6e\u63d2\u5165\u68c0\u67e5\u5373\u53ef\uff0c\u4e0d\u9700\u8981\u7ed9\u4e88\u8865\u4e01\u4efb\u610fhook\u7684\u80fd\u529b\u3002<\/p>\n<p>\u5177\u4f53\u6765\u8bf4\uff0c\u6211\u4eec\u6709\u5982\u4e0b\u9650\u5236\uff1a<\/p>\n<p>1)\u8865\u4e01\u53ef\u4ee5hook\u51fd\u6570\u5165\u53e3\uff0c\u68c0\u67e5\u53c2\u6570\u548c\u73af\u5883<\/p>\n<p>2)\u8865\u4e01\u4e5f\u53ef\u4ee5hook\u51fd\u6570\u4e2d\u7684\u8c03\u7528\uff0c\u524d\u63d0\u662f\u8be5\u8c03\u7528\u8fd4\u56de\u7684\u662f\u72b6\u6001\u503c\uff08\u4e0b\u6587\u53ea\u6709\u6761\u4ef6\u4f9d\u8d56\uff09\uff0c\u800c\u4e0d\u662f\u6307\u9488\u7b49\u6709\u6570\u503c\u4f9d\u8d56\u7684\u8fd4\u56de\u503c\uff08copy_from_user\u6ee1\u8db3\u8fd9\u4e00\u6761\u4ef6\uff0c\u8fd4\u56de\u662f\u6210\u529f\u6216\u5931\u8d25\u7684\u72b6\u6001\u503c\uff09<\/p>\n<p>3)\u8865\u4e01\u53ef\u4ee5\u4efb\u610f\u8bfb\uff0c\u4f46\u4e0d\u53ef\u5199\uff0c\u66f4\u4e0d\u80fd\u53d1\u9001\u6570\u636e\u51fa\u53bb<\/p>\n<p>4)\u8865\u4e01\u5b8c\u6210\u6761\u4ef6\u5224\u65ad\u540e\uff0c\u53ef\u8fd4\u56de\u6b63\u5e38\u6216\u5f02\u5e38\u3002\u8fd9\u6837\u5f53\u9047\u5230\u653b\u51fb\u8f93\u5165\u65f6\uff0c\u5185\u6838\u968f\u540e\u7684\u6267\u884c\u4e0d\u4f1a\u89e6\u53ca\u4f1a\u88abexploit\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u4e3a\u4e86\u66f4\u76f4\u89c2\u5730\u7406\u89e3\uff0cFigure 9\u7ed9\u51fa\u4e86\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\u3002fun\u8c03\u7528\u4e86foo \u548cbar\u3002\u5176\u4e2dfun\u7684\u5165\u53e3\u662f\u5141\u8bb8\u88abhook\u7684\uff0cfun\u4e2dfoo\u7684\u8c03\u7528\u524d\u548c\u8c03\u7528\u540e\u4e5f\u662f\u5141\u8bb8\u88abhook\u7684\uff0c\u56e0\u4e3afoo\u8fd4\u56de\u503c\u53ea\u6709\u6761\u4ef6\u4f9d\u8d56\uff0c\u800cbar\u662f\u4e0d\u80fd\u88abhook\u7684\uff0c\u56e0\u4e3a\u4e0b\u6587\u4ea7\u751f\u4e86\u6570\u503c\u4f9d\u8d56\uff08\u5176\u4e2d\u4e00\u4e2a\u57df\u88ab\u7528\u4f5c\u51fd\u6570\u6307\u9488\u8fdb\u884c\u8c03\u7528\uff09\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u653b\u51fb\u8005\u5373\u4f7f\u63a7\u5236\u4e86\u8865\u4e01\uff0c\u4e5f\u6ca1\u6cd5\u901a\u8fc7\u8fd4\u56de\u6076\u610f\u6570\u503c\u6765\u5b9e\u73b0\u4efb\u610f\u4ee3\u7801\u6267\u884c\u3002<\/p>\n<p style=\"text-align: center;\">\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1052 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/10.png\" alt=\"10\" width=\"600\" height=\"474\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/10.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/10-300x237.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/10-190x150.png 190w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/10-150x119.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>Figure 9: A running example to illustrate which functions can be hooked and which cannot<\/p>\n<p>\u6211\u4eec\u4e3a\u8fd4\u56de\u503c\u53ea\u6709\u6761\u4ef6\u4f9d\u8d56\u7684\u51fd\u6570\u751f\u6210\u4e86\u4e00\u4e2a\u767d\u540d\u5355\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u76ee\u6807\u51fd\u6570\uff0c\u5176\u8c03\u7528\u53ea\u6709\u5728\u843d\u5728\u8fd9\u4e2a\u96c6\u5408\u91cc\u65f6\u624d\u80fd\u88abhook\u68c0\u67e5\u3002\u800c\u4e14\u6ce8\u610fhook\u53d1\u751f\u5728\u76ee\u6807\u51fd\u6570\u8c03\u7528\u5904\uff0c\u800c\u4e0d\u662f\u88ab\u8c03\u7528\u51fd\u6570\u7684\u5165\u53e3\u548c\u8fd4\u56de\u5904\u3002\u6211\u4eec\u79f0\u80fd\u5728\u51fd\u6570\u53e3\u4f5c\u68c0\u67e5\u5373\u53ef\u4fee\u590d\u7684\u6f0f\u6d1e\u4e3aType I vulnerabilities\uff0c\u800c\u5982\u679c\u8fd8\u9700\u8981\u5728\u51fd\u6570\u4f53\u5185\u5bf9\u8c03\u7528\u505ahook\u68c0\u67e5\u7684\uff0c\u5219\u79f0\u4e3aType II vulnerabilities\u3002\u7a0d\u540e\u6211\u4eec\u4f1a\u7ed9\u51fa\u4e24\u79cd\u6f0f\u6d1e\u7684\u6570\u76ee\u3002<\/p>\n<p><strong>5.2 \u5b9e\u73b0<\/strong><\/p>\n<p>\u6211\u4eec\u57fa\u4e8eLua\u5b9e\u73b0\u4e86LuaKpatch\uff0c\u4e3a\u4e86\u5c06Lua\u96c6\u6210\u5728\u5185\u6838\u91cc\uff0c\u5f88\u591a\u6539\u53d8\u501f\u9274\u4e86lunatik-ng [16] . \u6bd4\u5982\u6570\u503c\u5e94\u8be5\u4fee\u6539\u4e3a\u6574\u578b\u800c\u975e\u6d6e\u70b9\u578b\u3002LuaKpatch\u7684\u4ee3\u7801\u5927\u7ea61\u4e071\u5343\u884c\uff0c\u5176\u4e2d\u6838\u5fc3\u7684\u4e0e\u4fee\u8865\u6709\u5173\u7684\u4ee3\u7801\u5927\u6982600\u884c\u3002\u7f16\u8bd1\u540eLuaKpatch\u6a21\u5757\u5927\u5c0f\u4e3a800KB\u3002\u5382\u5546\u53ef\u4ee5\u63d0\u524d\u5c06\u8fd9\u4e00\u6a21\u5757\u96c6\u6210\u4e8e\u5185\u6838\u91cc\uff0c\u6216\u8005\u53ef\u4ee5\u501f\u7528AdaptKpatch\u91cc\u6240\u4ecb\u7ecd\u7684\u5185\u6838\u6a21\u5757\u81ea\u9002\u5e94\u52a0\u8f7d\u65b9\u6cd5\uff0c\u540e\u5929\u7531\u7b2c\u4e09\u65b9root\u624b\u673a\u540e\u63d2\u5165\u5185\u6838\u3002<\/p>\n<p style=\"text-align: left;\">LuaKpatch\u4e3aLua\u5f62\u5f0f\u7684\u5185\u6838\u8865\u4e01\u63d0\u4f9b\u4e86\u5982\u4e0b\u63a5\u53e3\uff1a\u7b26\u53f7\u641c\u7d22\u3001hook\uff08\u5728\u6307\u5b9a\u4f4d\u7f6e\u63d2\u5165trampoline\uff0c\u4fdd\u5b58\u73b0\u573a\u5e76\u8c03\u7528Lua\u8865\u4e01\u7684handler\u8fdb\u884c\u5224\u5b9a\uff0c\u7136\u540e\u56de\u5230\u6307\u5b9a\u4f4d\u7f6e\u7684\u4e0b\u4e00\u6307\u4ee4\uff09\u3001\u5185\u5b58\u8bfb\u53d6\u3001thread\u4fe1\u606f\u83b7\u53d6\u3002 Figure 10 \u4e3a\u5229\u7528LuaKpatch\u4fee\u8865Towelroot\u6f0f\u6d1e\u7684\u5b9e\u4f8b\u3002\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/11-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1053 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/11-1.png\" alt=\"11\" width=\"600\" height=\"190\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/11-1.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/11-1-300x95.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/11-1-250x79.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/11-1-150x48.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Figure 10: Sample Lua patch to fix one of the vulnerable conditions of CVE-2014-3153, known as \u201cTowelroot\u201d<\/p>\n<p><strong>5.3 \u6709\u6548\u6027\u5206\u6790<\/strong><\/p>\n<p>\u5982Table 2\u6240\u793a\uff0c\u8fd1\u5e74\u51e0\u4e4e\u6709\u4ee3\u8868\u6027\u7684\u80fd\u7528\u6765root\u624b\u673a\u7684\u5185\u6838\u6f0f\u6d1eLuaKpatch\u90fd\u80fd\u4fee\u8865\u3002\u524d\u9762\u6709\u63d0\u5230\u80fd\u5728\u51fd\u6570\u53e3\u4f5c\u68c0\u67e5\u5373\u53ef\u4fee\u590d\u7684\u6f0f\u6d1e\u4e3aType I vulnerabilities\uff0c\u800c\u5982\u679c\u8fd8\u9700\u8981\u5728\u51fd\u6570\u4f53\u5185\u5bf9\u8c03\u7528\u505ahook\u68c0\u67e5\u7684\uff0c\u5219\u79f0\u4e3aType II vulnerabilities\u3002Figure 11\u63d0\u4f9b\u4e86\u8fd9\u4e24\u7c7b\u6f0f\u6d1e\u7684\u6bd4\u4f8b\uff0c\u5927\u90e8\u5206\u6f0f\u6d1e\u8fd8\u662f\u53ef\u4ee5\u7b80\u5355\u5730\u901a\u8fc7\u5728\u51fd\u6570\u53e3\u8fdb\u884c\u68c0\u67e5\u6765\u4fee\u8865\u7684\u3002\u4e07\u4e00\u9047\u5230LuaKpatch\u4e0d\u80fd\u4fee\u8865\u7684\u6f0f\u6d1e\uff0c\u53ef\u4ee5\u56de\u6eda\u5230AdaptKpatch\u65b9\u6848\u8fdb\u884c\u4fee\u8865\u3002<\/p>\n<p><a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1054 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/12.png\" alt=\"12\" width=\"597\" height=\"235\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/12.png 597w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/12-300x118.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/12-250x98.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/12-150x59.png 150w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a>\u3000\u3000Table 2: Android root vulnerabilities that have been verified to be protectable by LuaKpatch. Most of the vulnerabilities are Type I vulnerabilities (those that can be patched by simply hooking the entry of the vulnerable functions), but the highlighted\/colored ones are Type II vulnerabilities (those that also need to hook the invocations that return status code).<\/p>\n<p style=\"text-align: center;\">\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1055 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/13.png\" alt=\"13\" width=\"246\" height=\"160\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/13.png 246w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/13-231x150.png 231w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/13-150x98.png 150w\" sizes=\"auto, (max-width: 246px) 100vw, 246px\" \/><\/a>\u3000Figure 11: All 21 vulnerabilities that we collected can be patched by LuaKpatch. Among them, 16 are Type I vulnerabilities, and 5 are Type II vulnerabilities.<\/p>\n<p><strong>5.4 \u6027\u80fd\u6d4b\u8bd5<\/strong><\/p>\n<p>\u6211\u4eec\u7528CF-Bench [17] \u5728\u88c5\u6709Android 4.4\u7684Nexus 5 \u4e0a\u6d4b\u4e86\u56db\u79cd\u60c5\u51b5\uff1a\u4e0d\u6253\u8865\u4e01\uff0c\u7528LuaKpatch\u4fee\u8865Towelroot\uff0c\u7528LuaKpatch\u4fee\u8865Ping Pong Root\uff0c\u7528LuaKpatch\u4fee\u8865\u4e8c\u8005\u3002 \u7ed3\u679c\u5982Figure 12 \u6240\u793a\u2014\u2014LuaKpatch\u5b8c\u5168\u6ca1\u6709\u5e26\u6765\u4efb\u4f55\u6027\u80fd\u635f\u8017\u3002\u8fd9\u662f\u9884\u6599\u4e4b\u4e2d\u7684\uff0c\u56e0\u4e3a\u63d0\u6743\u5185\u6838\u6f0f\u6d1e\u5f80\u5f80\u51fa\u73b0\u5728\u5e73\u65f6\u65e0\u6cd5\u89e6\u53ca\u7684\u6267\u884c\u8def\u5f84\u4e0a\uff0c\u4fee\u8865\u540e\u5e76\u4e0d\u5bf9\u6b63\u5e38\u6267\u884c\u4ea7\u751f\u5f71\u54cd\u3002<\/p>\n<p style=\"text-align: center;\">\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1056 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/14.png\" alt=\"14\" width=\"593\" height=\"224\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/14.png 593w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/14-300x113.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/14-250x94.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/14-150x57.png 150w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/a>Figure 12: Performance scores obtained from CF-Bench<\/p>\n<p>\u5c3d\u7ba1\u5982\u6b64\uff0c\u6211\u4eec\u8fd8\u662f\u60f3\u77e5\u9053\u4e00\u65e6\u88ab\u89e6\u53ca\uff0cLuaKpatch\u7684\u5f00\u9500\u662f\u591a\u5c11\u3002\u56e0\u6b64\u6211\u4eec\u6d4b\u8bd5\u4e86chmod \u7cfb\u7edf\u8c03\u7528\u7684\u539f\u59cb\u6267\u884c\u65f6\u95f4\u3001\u6253\u4e0a\u8865\u4e01\u4f46\u662f\u8865\u4e01\u76f4\u63a5return\u7684\u6267\u884c\u65f6\u95f4\uff08\u76f8\u5f53\u4e8e\u53ea\u662f\u73b0\u573a\u4fdd\u5b58\u6062\u590d\u548cLua\u8fdb\u51fa\u7684\u5f00\u9500\uff09\u3001\u6253\u4e0a\u8865\u4e01\u4e14\u8865\u4e01\u505a\u4e00\u6b21\u6761\u4ef6\u5224\u65ad\u7684\u6267\u884c\u65f6\u95f4\u3001\u6253\u4e0a\u8865\u4e01\u4e14\u8865\u4e01\u505a\u4e00\u6b21\u5185\u5b58\u5730\u5740\u8bfb\u7684\u6267\u884c\u65f6\u95f4\u3001\u6253\u4e0a\u8865\u4e01\u4e14\u8865\u4e01\u505a\u4e00\u4e9b\u5217\u7efc\u5408\u64cd\u4f5c\uff08\u53d8\u91cf\u64cd\u4f5c\u3001\u5185\u5b58\u8bfb\u3001\u6761\u4ef6\u5224\u65ad\u7b49\uff0c\u6a21\u62df\u4e00\u4e2a\u6bd4Towelroot\u548cPing Pong Root\u8865\u4e01\u66f4\u590d\u6742\u7684\u8865\u4e01\u7684\u64cd\u4f5c\uff09\u7684\u6267\u884c\u65f6\u95f4\uff0c\u5176\u7ed3\u679c\u5982Figure 13\u6240\u793a\u3002\u53ef\u89c1\u5373\u4f7f\u5728\u590d\u6742\u8865\u4e01\u7684\u6267\u884c\u4e0b\uff0c\u4e5f\u53ea\u591a\u4e863.74\u5fae\u79d2\u7684\u5f00\u9500\u3002\u8fd9\u4ec5\u4ec5\u662fchmod\u6b63\u5e38\u6267\u884c\u76844%\u3002<\/p>\n<p style=\"text-align: center;\">\u3000\u3000<a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1057 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/15.png\" alt=\"15\" width=\"572\" height=\"252\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/15.png 572w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/15-300x132.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/15-250x110.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/15-150x66.png 150w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a>Figure 13: Execution time of chmod with\/without the patches<\/p>\n<p>\u57fa\u672c\u4e0a\uff0c\u5728\u6211\u4eec\u7684\u6d4b\u8bd5\u91cc\uff0cLuaKpatch\u8865\u4e01\u90fd\u80fd\u57285\u5fae\u79d2\u7684\u5f00\u9500\u91cc\u5b8c\u6210\u4efb\u52a1\u3002\u672a\u6765\u6211\u4eec\u4f1a\u628aLuaKpatch\u7684\u5f15\u64ce\u6362\u6210LuaJIT [19] \uff0c\u6027\u80fd\u4f1a\u5f97\u5230\u8fdb\u4e00\u6b65\u63d0\u5347\u3002<\/p>\n<p><strong>6. \u603b\u7ed3<\/strong><\/p>\n<p>\u57fa\u4e8e\u672c\u6587\u6240\u8ff0AdaptKpatch\u548cLuaKpatch\u6280\u672f\uff0cAndroid\u4fee\u8865\u6d41\u7a0b\u53ef\u4ee5\u6539\u8fdb\u6210\u5982Figure 14\u6240\u793a\u3002\u5bf9\u4e8e\u975e\u5e38\u4e25\u91cd\u7684\u95ee\u9898\u3001\u9700\u8981\u51e0\u5929\u5185\u63a8\u51fa\u8865\u4e01\u7684\uff0c\u53ef\u4ee5\u7528LuaKpatch\uff1b\u5bf9\u4e8eLuaKpatch\u4e0d\u80fd\u89e3\u51b3\u7684\u95ee\u9898\uff0c\u53ef\u4ee5\u7ecf\u8fc7\u8865\u4e01\u5ba1\u8ba1\u540e\u7528AdaptKpatch\u65b9\u6848\u63a8\u51fa\uff1b\u6700\u7ec8\u51b7\u8865\u4e01\u53ef\u4ee5\u6c38\u4e45\u6027\u5730\u4fee\u8865\u76f8\u5e94\u95ee\u9898\u3002\u57fa\u4e8e\u8fd9\u4e00\u6d41\u7a0b\uff0cAndroid\u5185\u6838\u6f0f\u6d1e\u957f\u671f\u96be\u4ee5\u88ab\u4fee\u590d\u7684\u95ee\u9898\u53ef\u4ee5\u5f97\u5230\u59a5\u5584\u89e3\u51b3\u3002<\/p>\n<p><a href=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1058 aligncenter\" src=\"http:\/\/www.inforsec.org\/wp\/wp-content\/uploads\/2016\/07\/16.png\" alt=\"16\" width=\"600\" height=\"114\" srcset=\"http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/16.png 600w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/16-300x57.png 300w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/16-250x48.png 250w, http:\/\/202.112.238.40\/wp\/wp-content\/uploads\/2016\/07\/16-150x29.png 150w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>\u3000Figure 14: The patching circle in the open collaborative patching ecosystem. From left to right, it takes more time for patches to land on user devices to take effect. And from left to right, the safety level also decreases. Note that AdaptKpatch can perfectly fix more issues than LuaKpatch, so when LuaKpatch is not an ideal choice, AdaptKpatch can be a great alternative.<\/p>\n<p>\u6211\u4eec\u547c\u5401Android\u751f\u6001\u5708\u5efa\u7acb\u4e00\u4e2a\u5f00\u653e\u534f\u4f5c\u7684\u8054\u76df\uff0c\u5305\u62ec\u624b\u673a\u5382\u5546\u3001\u5b89\u5168\u5382\u5546\u3001\u548c\u5176\u4ed6Android\u793e\u533a\u7684\u6210\u5458\u3002\u8fd9\u4e2a\u8054\u76df\u5c06\u5177\u6709\u975e\u5e38\u91cd\u8981\u7684\u610f\u4e49\uff1a<\/p>\n<p>1)\u6f0f\u6d1e\u8d8a\u6765\u8d8a\u591a\u4e5f\u8d8a\u6765\u8d8a\u590d\u6742\uff0c\u5728LuaKpatch\u548cAdaptKpatch\u63d0\u4f9b\u7684\u548c\u4f5c\u5e73\u53f0\u4e0a\uff0c\u5927\u5bb6\u53ef\u4ee5\u5206\u62c5\u4fee\u8865\u7684\u96be\u9898\uff0c\u5171\u4eab\u5176\u6210\uff1b<\/p>\n<p>2)\u5bf9\u4e8eAdaptKpatch\u7684\u573a\u666f\uff0c\u8d8a\u591a\u7684\u53c2\u4e0e\u8005\u610f\u5473\u7740\u66f4\u591a\u66f4\u5b89\u5168\u7684\u8865\u4e01\u5ba1\u8ba1\uff1b<\/p>\n<p>3)\u6700\u540e\u4f46\u4e5f\u662f\u6700\u91cd\u8981\u7684\uff0c\u6574\u4e2aAndroid\u751f\u6001\u5708\u5e94\u8be5\u4e00\u8d77\u5c06\u8fd9\u4e2a\u70ed\u4fee\u8865\u6d41\u7a0b\u7ef4\u62a4\u6210\u7edf\u4e00\u7684\u6807\u51c6\uff0c\u9632\u6b62\u5728\u5f53\u524d\u8bbe\u5907\u788e\u7247\u5316\u4e4b\u4e0a\u53c8\u5f15\u5165\u4e86\u4fee\u8865\u65b9\u6848\u7684\u788e\u7247\u5316\uff0c\u5bfc\u81f4\u6700\u7ec8\u8fd8\u662f\u5404\u65b9\u5206\u6563\u529b\u91cf\u4fee\u8865\u6f0f\u6d1e\u3001\u96be\u4ee5\u89c4\u6a21\u5316\u6709\u6548\u5730\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p>\u53c2\u8003\u6587\u732e\uff1a<\/p>\n<p>[1] http:\/\/www.cmcm.com\/blog\/en\/security\/2015-09-18\/799.html<\/p>\n<p>[2] https:\/\/www.fireeye.com\/blog\/threat-research\/2015\/10\/kemoge_another_mobi.html<\/p>\n<p>[3] https:\/\/www.bluecoat.com\/security-blog\/2016-04-25\/android-exploit-delivers-dogspectus-ransomware<\/p>\n<p>[4] https:\/\/blog.checkpoint.com\/wp-content\/uploads\/2016\/07\/HummingBad-Research-report_FINAL-62916.pdf<\/p>\n<p>[5] http:\/\/opensignal.com\/reports\/2015\/08\/android-fragmentation<\/p>\n<p>[6] https:\/\/developer.android.com\/about\/dashboards\/index.html<\/p>\n<p>[7] https:\/\/github.com\/torvalds\/linux\/commit\/e9c243a5a6de0be8e584c604d353412584b592f8<\/p>\n<p>[8] https:\/\/source.android.com\/security\/bulletin\/2015-09-01.html<\/p>\n<p>[9] https:\/\/github.com\/torvalds\/linux\/commit\/f0d1bec9d58d4c038d0ac958c9af82be6eb18045<\/p>\n<p>[10] http:\/\/source.android.com\/security\/advisory\/2016-03-18.html<\/p>\n<p>[11] https:\/\/github.com\/dynup\/kpatch<\/p>\n<p>[12] https:\/\/www.ksplice.com\/doc\/ksplice.pdf<\/p>\n<p>[13] http:\/\/events.linuxfoundation.org\/sites\/events\/files\/slides\/kGraft.pdf<\/p>\n<p>[14] http:\/\/lxr.free-electrons.com\/source\/include\/linux\/livepatch.h<\/p>\n<p>[15] https:\/\/conference.hitb.org\/hitbsecconf2016ams\/sessions\/adaptive-android-kernel-live-patching<\/p>\n<p>[16] https:\/\/github.com\/lunatik-ng\/lunatik-ng<\/p>\n<p>[17] https:\/\/play.google.com\/store\/apps\/details?id=eu.chainfire.cfbench&amp;hl=en<\/p>\n<p>[18] https:\/\/httpd.apache.org\/docs\/2.4\/programs\/ab.html<\/p>\n<p>[19] http:\/\/luajit.org<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u5f20\u715c\u9f99 \u00a0 \u9648\u8d8a \u00a0\u5305\u6c89\u6d6e \u00a0\u590f\u826f\u948a \u00a0\u90d1\u9f99\u65e5\u00a0\u00a0\u5362\u6c38\u5f3a\u00a0 \u00a0\u97e6\u97ec\uff08Baidu X-Lab\uff09 &#8230; <a class=\"continue-reading-link\" href=\"http:\/\/202.112.238.40\/wp\/?p=1042\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1042","post","type-post","status-publish","format-standard","hentry","category-research"],"_links":{"self":[{"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1042"}],"version-history":[{"count":8,"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1042\/revisions"}],"predecessor-version":[{"id":1066,"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1042\/revisions\/1066"}],"wp:attachment":[{"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1042"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/202.112.238.40\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}