)]}' { "commit": "3f88826b531a81d6097c4e42a92f4f4d2d41ccd4", "tree": "b7aefd286560ae943421006456ad2ed7951aff98", "parents": [ "bb04803b8daf08e186b327d18e14c78378f44e37" ], "author": { "name": "Alistair Delva", "email": "adelva@google.com", "time": "Tue Feb 09 13:10:54 2021 -0800" }, "committer": { "name": "swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com", "email": "swiftshader-scoped@luci-project-accounts.iam.gserviceaccount.com", "time": "Wed Feb 17 18:10:42 2021 +0000" }, "message": "Fix support for named mmap usage on Android\n\nUsing a memfd name to annotate swiftshader_jit allocations is quite\nclever, but it doesn\u0027t work on Android because memfds can be shared\nand so writing to mappings of them promotes CoW/shared, which is\nclassified by selinux as \u0027execmod\u0027 permission. Android prohibits\n\u0027execmod\u0027 permission for new app processes, because this is usually a\nsign the app relies on shared text relocations, which are insecure. In\nthis case, that isn\u0027t actually happening, but we are subject to the\nsame blanket ban :)\n\nFortunately, Android has a longtime non-upstreamed prctl() to allow\nprivate mappings to be named as well, PR_SET_VMA_ANON_NAME. As this\nisn\u0027t generally available for Linux, wrap it in checks for __ANDROID__.\n\nThis enables the naming without tripping the \u0027execmod\u0027 permission check.\n\nBug: b/171498948\nBug: b/174801963\nChange-Id: Ic4375bc4407e21ecdafb42a7cec651dc3b2ad13e\nReviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52669\nReviewed-by: Jason Macnak \u003cnatsu@google.com\u003e\nReviewed-by: Nicolas Capens \u003cnicolascapens@google.com\u003e\nPresubmit-Ready: Jason Macnak \u003cnatsu@google.com\u003e\nTested-by: Jason Macnak \u003cnatsu@google.com\u003e\nKokoro-Result: kokoro \u003cnoreply+kokoro@google.com\u003e\nCommit-Queue: Jason Macnak \u003cnatsu@google.com\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "46b448076c1f9f894e271123a193f1bd54f1a85b", "old_mode": 33188, "old_path": "src/Reactor/ExecutableMemory.cpp", "new_id": "7174cb3fad57f8b0486008337287becdfde12352", "new_mode": 33188, "new_path": "src/Reactor/ExecutableMemory.cpp" } ] }