{"action":"created","comment":{"url":"https://api.github.com/repos/opencontainers/runc/pulls/comments/92809741","pull_request_review_id":13324250,"id":92809741,"diff_hunk":"@@ -700,17 +700,26 @@ func createIfNotExists(path string, isDir bool) error {\n \treturn nil\n }\n \n-// remountReadonly will bind over the top of an existing path and ensure that it is read-only.\n-func remountReadonly(path string) error {\n+// readonlyPath will make a path read only.\n+func readonlyPath(path string) error {\n+\tif err := syscall.Mount(path, path, \"\", syscall.MS_BIND|syscall.MS_REC, \"\"); err != nil {\n+\t\tif os.IsNotExist(err) {\n+\t\t\treturn nil\n+\t\t}\n+\t\treturn err\n+\t}\n+\treturn syscall.Mount(path, path, \"\", syscall.MS_BIND|syscall.MS_REMOUNT|syscall.MS_RDONLY|syscall.MS_REC, \"\")","path":"libcontainer/rootfs_linux.go","position":23,"original_position":23,"commit_id":"6b664ea0f42d18efa18466a3f3b4fcfcf63021b6","original_commit_id":"6b664ea0f42d18efa18466a3f3b4fcfcf63021b6","user":{"login":"cyphar","id":2888411,"avatar_url":"https://avatars.githubusercontent.com/u/2888411?v=3","gravatar_id":"","url":"https://api.github.com/users/cyphar","html_url":"https://github.com/cyphar","followers_url":"https://api.github.com/users/cyphar/followers","following_url":"https://api.github.com/users/cyphar/following{/other_user}","gists_url":"https://api.github.com/users/cyphar/gists{/gist_id}","starred_url":"https://api.github.com/users/cyphar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyphar/subscriptions","organizations_url":"https://api.github.com/users/cyphar/orgs","repos_url":"https://api.github.com/users/cyphar/repos","events_url":"https://api.github.com/users/cyphar/events{/privacy}","received_events_url":"https://api.github.com/users/cyphar/received_events","type":"User","site_admin":false},"body":"I'm not sure we should've dropped the `|defaultMountFlags` from here.","created_at":"2016-12-16T13:19:02Z","updated_at":"2016-12-16T13:19:02Z","html_url":"https://github.com/opencontainers/runc/pull/1222#discussion_r92809741","pull_request_url":"https://api.github.com/repos/opencontainers/runc/pulls/1222","_links":{"self":{"href":"https://api.github.com/repos/opencontainers/runc/pulls/comments/92809741"},"html":{"href":"https://github.com/opencontainers/runc/pull/1222#discussion_r92809741"},"pull_request":{"href":"https://api.github.com/repos/opencontainers/runc/pulls/1222"}}},"pull_request":{"url":"https://api.github.com/repos/opencontainers/runc/pulls/1222","id":97445929,"html_url":"https://github.com/opencontainers/runc/pull/1222","diff_url":"https://github.com/opencontainers/runc/pull/1222.diff","patch_url":"https://github.com/opencontainers/runc/pull/1222.patch","issue_url":"https://api.github.com/repos/opencontainers/runc/issues/1222","number":1222,"state":"open","locked":false,"title":"Split the code for remounting mount points and mounting paths.","user":{"login":"justincormack","id":482364,"avatar_url":"https://avatars.githubusercontent.com/u/482364?v=3","gravatar_id":"","url":"https://api.github.com/users/justincormack","html_url":"https://github.com/justincormack","followers_url":"https://api.github.com/users/justincormack/followers","following_url":"https://api.github.com/users/justincormack/following{/other_user}","gists_url":"https://api.github.com/users/justincormack/gists{/gist_id}","starred_url":"https://api.github.com/users/justincormack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justincormack/subscriptions","organizations_url":"https://api.github.com/users/justincormack/orgs","repos_url":"https://api.github.com/users/justincormack/repos","events_url":"https://api.github.com/users/justincormack/events{/privacy}","received_events_url":"https://api.github.com/users/justincormack/received_events","type":"User","site_admin":false},"body":"fix #1223 \r\n\r\nA remount of a mount point must include all the current flags or\r\nthese will be cleared:\r\n\r\n```\r\nThe mountflags and data arguments should match the values used in the\r\noriginal mount() call, except for those parameters that are being\r\ndeliberately changed.\r\n```\r\n\r\nThe current code does not do this; the bug manifests in the specified\r\nflags for `/dev` being lost on remount read only at present. As we\r\nneed to specify flags, split the code path for this from remounting\r\npaths which are not mount points, as these can only inherit the\r\nexisting flags of the path, and these cannot be changed.\r\n\r\nIn the bind case, remove extra flags from the bind remount. A bind\r\nmount can only be remounted read only, no other flags can be set,\r\nall other flags are inherited from the parent. From the man page:\r\n\r\n```\r\nSince Linux 2.6.26, this flag can also be used to make an existing\r\nbind mount read-only by specifying mountflags as:\r\n\r\nMS_REMOUNT | MS_BIND | MS_RDONLY\r\n\r\nNote that only the MS_RDONLY setting of the bind mount can be changed\r\nin this manner.\r\n```\r\n\r\nMS_REC can only be set on the original bind, so move this. See note\r\nin man page on bind mounts:\r\n\r\n```\r\nThe remaining bits in the mountflags argument are also ignored, with\r\nthe exception of MS_REC.\r\n```\r\n\r\nSigned-off-by: Justin Cormack <justin.cormack@docker.com>","created_at":"2016-12-11T02:29:44Z","updated_at":"2016-12-16T13:19:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f864462f2825d54591244ec3f57c8d0d3fe008c8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencontainers/runc/pulls/1222/commits","review_comments_url":"https://api.github.com/repos/opencontainers/runc/pulls/1222/comments","review_comment_url":"https://api.github.com/repos/opencontainers/runc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencontainers/runc/issues/1222/comments","statuses_url":"https://api.github.com/repos/opencontainers/runc/statuses/6b664ea0f42d18efa18466a3f3b4fcfcf63021b6","head":{"label":"justincormack:remount-fixes","ref":"remount-fixes","sha":"6b664ea0f42d18efa18466a3f3b4fcfcf63021b6","user":{"login":"justincormack","id":482364,"avatar_url":"https://avatars.githubusercontent.com/u/482364?v=3","gravatar_id":"","url":"https://api.github.com/users/justincormack","html_url":"https://github.com/justincormack","followers_url":"https://api.github.com/users/justincormack/followers","following_url":"https://api.github.com/users/justincormack/following{/other_user}","gists_url":"https://api.github.com/users/justincormack/gists{/gist_id}","starred_url":"https://api.github.com/users/justincormack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justincormack/subscriptions","organizations_url":"https://api.github.com/users/justincormack/orgs","repos_url":"https://api.github.com/users/justincormack/repos","events_url":"https://api.github.com/users/justincormack/events{/privacy}","received_events_url":"https://api.github.com/users/justincormack/received_events","type":"User","site_admin":false},"repo":{"id":42532117,"name":"runc","full_name":"justincormack/runc","owner":{"login":"justincormack","id":482364,"avatar_url":"https://avatars.githubusercontent.com/u/482364?v=3","gravatar_id":"","url":"https://api.github.com/users/justincormack","html_url":"https://github.com/justincormack","followers_url":"https://api.github.com/users/justincormack/followers","following_url":"https://api.github.com/users/justincormack/following{/other_user}","gists_url":"https://api.github.com/users/justincormack/gists{/gist_id}","starred_url":"https://api.github.com/users/justincormack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justincormack/subscriptions","organizations_url":"https://api.github.com/users/justincormack/orgs","repos_url":"https://api.github.com/users/justincormack/repos","events_url":"https://api.github.com/users/justincormack/events{/privacy}","received_events_url":"https://api.github.com/users/justincormack/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justincormack/runc","description":"runc container cli tools","fork":true,"url":"https://api.github.com/repos/justincormack/runc","forks_url":"https://api.github.com/repos/justincormack/runc/forks","keys_url":"https://api.github.com/repos/justincormack/runc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justincormack/runc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justincormack/runc/teams","hooks_url":"https://api.github.com/repos/justincormack/runc/hooks","issue_events_url":"https://api.github.com/repos/justincormack/runc/issues/events{/number}","events_url":"https://api.github.com/repos/justincormack/runc/events","assignees_url":"https://api.github.com/repos/justincormack/runc/assignees{/user}","branches_url":"https://api.github.com/repos/justincormack/runc/branches{/branch}","tags_url":"https://api.github.com/repos/justincormack/runc/tags","blobs_url":"https://api.github.com/repos/justincormack/runc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justincormack/runc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justincormack/runc/git/refs{/sha}","trees_url":"https://api.github.com/repos/justincormack/runc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justincormack/runc/statuses/{sha}","languages_url":"https://api.github.com/repos/justincormack/runc/languages","stargazers_url":"https://api.github.com/repos/justincormack/runc/stargazers","contributors_url":"https://api.github.com/repos/justincormack/runc/contributors","subscribers_url":"https://api.github.com/repos/justincormack/runc/subscribers","subscription_url":"https://api.github.com/repos/justincormack/runc/subscription","commits_url":"https://api.github.com/repos/justincormack/runc/commits{/sha}","git_commits_url":"https://api.github.com/repos/justincormack/runc/git/commits{/sha}","comments_url":"https://api.github.com/repos/justincormack/runc/comments{/number}","issue_comment_url":"https://api.github.com/repos/justincormack/runc/issues/comments{/number}","contents_url":"https://api.github.com/repos/justincormack/runc/contents/{+path}","compare_url":"https://api.github.com/repos/justincormack/runc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justincormack/runc/merges","archive_url":"https://api.github.com/repos/justincormack/runc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justincormack/runc/downloads","issues_url":"https://api.github.com/repos/justincormack/runc/issues{/number}","pulls_url":"https://api.github.com/repos/justincormack/runc/pulls{/number}","milestones_url":"https://api.github.com/repos/justincormack/runc/milestones{/number}","notifications_url":"https://api.github.com/repos/justincormack/runc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justincormack/runc/labels{/name}","releases_url":"https://api.github.com/repos/justincormack/runc/releases{/id}","deployments_url":"https://api.github.com/repos/justincormack/runc/deployments","created_at":"2015-09-15T16:34:38Z","updated_at":"2016-04-27T15:11:07Z","pushed_at":"2016-12-16T01:20:42Z","git_url":"git://github.com/justincormack/runc.git","ssh_url":"git@github.com:justincormack/runc.git","clone_url":"https://github.com/justincormack/runc.git","svn_url":"https://github.com/justincormack/runc","homepage":"","size":3916,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opencontainers:master","ref":"master","sha":"083933fb9092a3d65d682ba34a08676104c95462","user":{"login":"opencontainers","id":12563465,"avatar_url":"https://avatars.githubusercontent.com/u/12563465?v=3","gravatar_id":"","url":"https://api.github.com/users/opencontainers","html_url":"https://github.com/opencontainers","followers_url":"https://api.github.com/users/opencontainers/followers","following_url":"https://api.github.com/users/opencontainers/following{/other_user}","gists_url":"https://api.github.com/users/opencontainers/gists{/gist_id}","starred_url":"https://api.github.com/users/opencontainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencontainers/subscriptions","organizations_url":"https://api.github.com/users/opencontainers/orgs","repos_url":"https://api.github.com/users/opencontainers/repos","events_url":"https://api.github.com/users/opencontainers/events{/privacy}","received_events_url":"https://api.github.com/users/opencontainers/received_events","type":"Organization","site_admin":false},"repo":{"id":36960321,"name":"runc","full_name":"opencontainers/runc","owner":{"login":"opencontainers","id":12563465,"avatar_url":"https://avatars.githubusercontent.com/u/12563465?v=3","gravatar_id":"","url":"https://api.github.com/users/opencontainers","html_url":"https://github.com/opencontainers","followers_url":"https://api.github.com/users/opencontainers/followers","following_url":"https://api.github.com/users/opencontainers/following{/other_user}","gists_url":"https://api.github.com/users/opencontainers/gists{/gist_id}","starred_url":"https://api.github.com/users/opencontainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencontainers/subscriptions","organizations_url":"https://api.github.com/users/opencontainers/orgs","repos_url":"https://api.github.com/users/opencontainers/repos","events_url":"https://api.github.com/users/opencontainers/events{/privacy}","received_events_url":"https://api.github.com/users/opencontainers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencontainers/runc","description":"CLI tool for spawning and running containers according to the OCI specification","fork":false,"url":"https://api.github.com/repos/opencontainers/runc","forks_url":"https://api.github.com/repos/opencontainers/runc/forks","keys_url":"https://api.github.com/repos/opencontainers/runc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencontainers/runc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencontainers/runc/teams","hooks_url":"https://api.github.com/repos/opencontainers/runc/hooks","issue_events_url":"https://api.github.com/repos/opencontainers/runc/issues/events{/number}","events_url":"https://api.github.com/repos/opencontainers/runc/events","assignees_url":"https://api.github.com/repos/opencontainers/runc/assignees{/user}","branches_url":"https://api.github.com/repos/opencontainers/runc/branches{/branch}","tags_url":"https://api.github.com/repos/opencontainers/runc/tags","blobs_url":"https://api.github.com/repos/opencontainers/runc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencontainers/runc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencontainers/runc/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencontainers/runc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencontainers/runc/statuses/{sha}","languages_url":"https://api.github.com/repos/opencontainers/runc/languages","stargazers_url":"https://api.github.com/repos/opencontainers/runc/stargazers","contributors_url":"https://api.github.com/repos/opencontainers/runc/contributors","subscribers_url":"https://api.github.com/repos/opencontainers/runc/subscribers","subscription_url":"https://api.github.com/repos/opencontainers/runc/subscription","commits_url":"https://api.github.com/repos/opencontainers/runc/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencontainers/runc/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencontainers/runc/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencontainers/runc/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencontainers/runc/contents/{+path}","compare_url":"https://api.github.com/repos/opencontainers/runc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencontainers/runc/merges","archive_url":"https://api.github.com/repos/opencontainers/runc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencontainers/runc/downloads","issues_url":"https://api.github.com/repos/opencontainers/runc/issues{/number}","pulls_url":"https://api.github.com/repos/opencontainers/runc/pulls{/number}","milestones_url":"https://api.github.com/repos/opencontainers/runc/milestones{/number}","notifications_url":"https://api.github.com/repos/opencontainers/runc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencontainers/runc/labels{/name}","releases_url":"https://api.github.com/repos/opencontainers/runc/releases{/id}","deployments_url":"https://api.github.com/repos/opencontainers/runc/deployments","created_at":"2015-06-05T23:30:45Z","updated_at":"2016-12-16T06:14:41Z","pushed_at":"2016-12-16T06:37:01Z","git_url":"git://github.com/opencontainers/runc.git","ssh_url":"git@github.com:opencontainers/runc.git","clone_url":"https://github.com/opencontainers/runc.git","svn_url":"https://github.com/opencontainers/runc","homepage":"https://www.opencontainers.org/","size":3923,"stargazers_count":3379,"watchers_count":3379,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":511,"mirror_url":null,"open_issues_count":109,"forks":511,"open_issues":109,"watchers":3379,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencontainers/runc/pulls/1222"},"html":{"href":"https://github.com/opencontainers/runc/pull/1222"},"issue":{"href":"https://api.github.com/repos/opencontainers/runc/issues/1222"},"comments":{"href":"https://api.github.com/repos/opencontainers/runc/issues/1222/comments"},"review_comments":{"href":"https://api.github.com/repos/opencontainers/runc/pulls/1222/comments"},"review_comment":{"href":"https://api.github.com/repos/opencontainers/runc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencontainers/runc/pulls/1222/commits"},"statuses":{"href":"https://api.github.com/repos/opencontainers/runc/statuses/6b664ea0f42d18efa18466a3f3b4fcfcf63021b6"}}}}
{"actor":{"display_login":"cyphar"}}