{"action":"created","comment":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments/71516847","id":71516847,"diff_hunk":"@@ -0,0 +1,600 @@\n+/*\n+ * Copyright (c) 2016, Linaro Limited\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright notice,\n+ * this list of conditions and the following disclaimer.\n+ *\n+ * 2. Redistributions in binary form must reproduce the above copyright notice,\n+ * this list of conditions and the following disclaimer in the documentation\n+ * and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <assert.h>\n+#include <kernel/thread.h>\n+#include <mm/core_memprot.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <tee/tee_fs.h>\n+#include <tee/tee_fs_rpc.h>\n+#include <trace.h>\n+#include <util.h>\n+\n+#define RPC_FAILED -1\n+\n+struct tee_fs_dir {\n+\tint nw_dir;\n+\tstruct tee_fs_dirent d;\n+};\n+\n+static TEE_Result tee_fs_rpc_send_cmd(int cmd_id, struct tee_fs_rpc *bf_cmd,\n+\t\t\t\t      void *data, uint32_t len, uint32_t mode)\n+{\n+\tTEE_Result ret;\n+\tstruct optee_msg_param params;\n+\tpaddr_t phpayload = 0;\n+\tuint64_t cpayload = 0;\n+\tstruct tee_fs_rpc *bf;\n+\tint res = TEE_ERROR_GENERIC;\n+\n+\tassert(cmd_id == OPTEE_MSG_RPC_CMD_FS ||\n+\t       cmd_id == OPTEE_MSG_RPC_CMD_SQL_FS);\n+\n+\tthread_rpc_alloc_payload(sizeof(struct tee_fs_rpc) + len,\n+\t\t\t\t &phpayload, &cpayload);\n+\tif (!phpayload)\n+\t\treturn TEE_ERROR_OUT_OF_MEMORY;\n+\n+\tif (!ALIGNMENT_IS_OK(phpayload, struct tee_fs_rpc))\n+\t\tgoto exit;\n+\n+\tbf = phys_to_virt(phpayload, MEM_AREA_NSEC_SHM);","path":"core/tee/tee_fs_rpc.c","position":66,"original_position":66,"commit_id":"772653438970a01729cab6910e1776e840697056","original_commit_id":"772653438970a01729cab6910e1776e840697056","user":{"login":"jenswi-linaro","id":6150306,"avatar_url":"https://avatars.githubusercontent.com/u/6150306?v=3","gravatar_id":"","url":"https://api.github.com/users/jenswi-linaro","html_url":"https://github.com/jenswi-linaro","followers_url":"https://api.github.com/users/jenswi-linaro/followers","following_url":"https://api.github.com/users/jenswi-linaro/following{/other_user}","gists_url":"https://api.github.com/users/jenswi-linaro/gists{/gist_id}","starred_url":"https://api.github.com/users/jenswi-linaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenswi-linaro/subscriptions","organizations_url":"https://api.github.com/users/jenswi-linaro/orgs","repos_url":"https://api.github.com/users/jenswi-linaro/repos","events_url":"https://api.github.com/users/jenswi-linaro/events{/privacy}","received_events_url":"https://api.github.com/users/jenswi-linaro/received_events","type":"User","site_admin":false},"body":"Yeah, I was a bit surprised myself. :-) ","created_at":"2016-07-20T12:44:25Z","updated_at":"2016-07-20T12:44:25Z","html_url":"https://github.com/OP-TEE/optee_os/pull/797#discussion_r71516847","pull_request_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797","_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments/71516847"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/797#discussion_r71516847"},"pull_request":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797"}}},"pull_request":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797","id":70530109,"html_url":"https://github.com/OP-TEE/optee_os/pull/797","diff_url":"https://github.com/OP-TEE/optee_os/pull/797.diff","patch_url":"https://github.com/OP-TEE/optee_os/pull/797.patch","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/797","number":797,"state":"open","locked":false,"title":"SQL FS","user":{"login":"jforissier","id":8288195,"avatar_url":"https://avatars.githubusercontent.com/u/8288195?v=3","gravatar_id":"","url":"https://api.github.com/users/jforissier","html_url":"https://github.com/jforissier","followers_url":"https://api.github.com/users/jforissier/followers","following_url":"https://api.github.com/users/jforissier/following{/other_user}","gists_url":"https://api.github.com/users/jforissier/gists{/gist_id}","starred_url":"https://api.github.com/users/jforissier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jforissier/subscriptions","organizations_url":"https://api.github.com/users/jforissier/orgs","repos_url":"https://api.github.com/users/jforissier/repos","events_url":"https://api.github.com/users/jforissier/events{/privacy}","received_events_url":"https://api.github.com/users/jforissier/received_events","type":"User","site_admin":false},"body":"Depends on https://github.com/OP-TEE/optee_client/pull/50.","created_at":"2016-05-18T13:44:48Z","updated_at":"2016-07-20T12:44:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bed8cf1ce1debd4849311b6ba859ea35d2e43596","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797/commits","review_comments_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797/comments","review_comment_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/797/comments","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/772653438970a01729cab6910e1776e840697056","head":{"label":"jforissier:sqlfs","ref":"sqlfs","sha":"772653438970a01729cab6910e1776e840697056","user":{"login":"jforissier","id":8288195,"avatar_url":"https://avatars.githubusercontent.com/u/8288195?v=3","gravatar_id":"","url":"https://api.github.com/users/jforissier","html_url":"https://github.com/jforissier","followers_url":"https://api.github.com/users/jforissier/followers","following_url":"https://api.github.com/users/jforissier/following{/other_user}","gists_url":"https://api.github.com/users/jforissier/gists{/gist_id}","starred_url":"https://api.github.com/users/jforissier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jforissier/subscriptions","organizations_url":"https://api.github.com/users/jforissier/orgs","repos_url":"https://api.github.com/users/jforissier/repos","events_url":"https://api.github.com/users/jforissier/events{/privacy}","received_events_url":"https://api.github.com/users/jforissier/received_events","type":"User","site_admin":false},"repo":{"id":22514248,"name":"optee_os","full_name":"jforissier/optee_os","owner":{"login":"jforissier","id":8288195,"avatar_url":"https://avatars.githubusercontent.com/u/8288195?v=3","gravatar_id":"","url":"https://api.github.com/users/jforissier","html_url":"https://github.com/jforissier","followers_url":"https://api.github.com/users/jforissier/followers","following_url":"https://api.github.com/users/jforissier/following{/other_user}","gists_url":"https://api.github.com/users/jforissier/gists{/gist_id}","starred_url":"https://api.github.com/users/jforissier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jforissier/subscriptions","organizations_url":"https://api.github.com/users/jforissier/orgs","repos_url":"https://api.github.com/users/jforissier/repos","events_url":"https://api.github.com/users/jforissier/events{/privacy}","received_events_url":"https://api.github.com/users/jforissier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jforissier/optee_os","description":"Trusted side of the TEE","fork":true,"url":"https://api.github.com/repos/jforissier/optee_os","forks_url":"https://api.github.com/repos/jforissier/optee_os/forks","keys_url":"https://api.github.com/repos/jforissier/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jforissier/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jforissier/optee_os/teams","hooks_url":"https://api.github.com/repos/jforissier/optee_os/hooks","issue_events_url":"https://api.github.com/repos/jforissier/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/jforissier/optee_os/events","assignees_url":"https://api.github.com/repos/jforissier/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/jforissier/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/jforissier/optee_os/tags","blobs_url":"https://api.github.com/repos/jforissier/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jforissier/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jforissier/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/jforissier/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jforissier/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/jforissier/optee_os/languages","stargazers_url":"https://api.github.com/repos/jforissier/optee_os/stargazers","contributors_url":"https://api.github.com/repos/jforissier/optee_os/contributors","subscribers_url":"https://api.github.com/repos/jforissier/optee_os/subscribers","subscription_url":"https://api.github.com/repos/jforissier/optee_os/subscription","commits_url":"https://api.github.com/repos/jforissier/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/jforissier/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/jforissier/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/jforissier/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/jforissier/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/jforissier/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jforissier/optee_os/merges","archive_url":"https://api.github.com/repos/jforissier/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jforissier/optee_os/downloads","issues_url":"https://api.github.com/repos/jforissier/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/jforissier/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/jforissier/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/jforissier/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jforissier/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/jforissier/optee_os/releases{/id}","deployments_url":"https://api.github.com/repos/jforissier/optee_os/deployments","created_at":"2014-08-01T14:48:31Z","updated_at":"2016-03-11T08:17:47Z","pushed_at":"2016-07-19T09:27:00Z","git_url":"git://github.com/jforissier/optee_os.git","ssh_url":"git@github.com:jforissier/optee_os.git","clone_url":"https://github.com/jforissier/optee_os.git","svn_url":"https://github.com/jforissier/optee_os","homepage":null,"size":9482,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"OP-TEE:master","ref":"master","sha":"2a7f41713ebc204566268e8e94517ee4ee879d44","user":{"login":"OP-TEE","id":7488961,"avatar_url":"https://avatars.githubusercontent.com/u/7488961?v=3","gravatar_id":"","url":"https://api.github.com/users/OP-TEE","html_url":"https://github.com/OP-TEE","followers_url":"https://api.github.com/users/OP-TEE/followers","following_url":"https://api.github.com/users/OP-TEE/following{/other_user}","gists_url":"https://api.github.com/users/OP-TEE/gists{/gist_id}","starred_url":"https://api.github.com/users/OP-TEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OP-TEE/subscriptions","organizations_url":"https://api.github.com/users/OP-TEE/orgs","repos_url":"https://api.github.com/users/OP-TEE/repos","events_url":"https://api.github.com/users/OP-TEE/events{/privacy}","received_events_url":"https://api.github.com/users/OP-TEE/received_events","type":"Organization","site_admin":false},"repo":{"id":20193261,"name":"optee_os","full_name":"OP-TEE/optee_os","owner":{"login":"OP-TEE","id":7488961,"avatar_url":"https://avatars.githubusercontent.com/u/7488961?v=3","gravatar_id":"","url":"https://api.github.com/users/OP-TEE","html_url":"https://github.com/OP-TEE","followers_url":"https://api.github.com/users/OP-TEE/followers","following_url":"https://api.github.com/users/OP-TEE/following{/other_user}","gists_url":"https://api.github.com/users/OP-TEE/gists{/gist_id}","starred_url":"https://api.github.com/users/OP-TEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OP-TEE/subscriptions","organizations_url":"https://api.github.com/users/OP-TEE/orgs","repos_url":"https://api.github.com/users/OP-TEE/repos","events_url":"https://api.github.com/users/OP-TEE/events{/privacy}","received_events_url":"https://api.github.com/users/OP-TEE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OP-TEE/optee_os","description":"Trusted side of the TEE","fork":false,"url":"https://api.github.com/repos/OP-TEE/optee_os","forks_url":"https://api.github.com/repos/OP-TEE/optee_os/forks","keys_url":"https://api.github.com/repos/OP-TEE/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OP-TEE/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OP-TEE/optee_os/teams","hooks_url":"https://api.github.com/repos/OP-TEE/optee_os/hooks","issue_events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/OP-TEE/optee_os/events","assignees_url":"https://api.github.com/repos/OP-TEE/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/OP-TEE/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/OP-TEE/optee_os/tags","blobs_url":"https://api.github.com/repos/OP-TEE/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OP-TEE/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OP-TEE/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/OP-TEE/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/OP-TEE/optee_os/languages","stargazers_url":"https://api.github.com/repos/OP-TEE/optee_os/stargazers","contributors_url":"https://api.github.com/repos/OP-TEE/optee_os/contributors","subscribers_url":"https://api.github.com/repos/OP-TEE/optee_os/subscribers","subscription_url":"https://api.github.com/repos/OP-TEE/optee_os/subscription","commits_url":"https://api.github.com/repos/OP-TEE/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/OP-TEE/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/OP-TEE/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/OP-TEE/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OP-TEE/optee_os/merges","archive_url":"https://api.github.com/repos/OP-TEE/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OP-TEE/optee_os/downloads","issues_url":"https://api.github.com/repos/OP-TEE/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/OP-TEE/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/OP-TEE/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/OP-TEE/optee_os/releases{/id}","deployments_url":"https://api.github.com/repos/OP-TEE/optee_os/deployments","created_at":"2014-05-26T17:18:57Z","updated_at":"2016-07-18T09:29:32Z","pushed_at":"2016-07-20T12:34:01Z","git_url":"git://github.com/OP-TEE/optee_os.git","ssh_url":"git@github.com:OP-TEE/optee_os.git","clone_url":"https://github.com/OP-TEE/optee_os.git","svn_url":"https://github.com/OP-TEE/optee_os","homepage":null,"size":10702,"stargazers_count":136,"watchers_count":136,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":141,"mirror_url":null,"open_issues_count":40,"forks":141,"open_issues":40,"watchers":136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/797"},"issue":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/797"},"comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/797/comments"},"review_comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797/comments"},"review_comment":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/797/commits"},"statuses":{"href":"https://api.github.com/repos/OP-TEE/optee_os/statuses/772653438970a01729cab6910e1776e840697056"}}}}
{"actor":{"display_login":"jenswi-linaro"}}