{"action":"opened","issue":{"url":"https://api.github.com/repos/shinyquagsire23/bootstrap/issues/7","labels_url":"https://api.github.com/repos/shinyquagsire23/bootstrap/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/shinyquagsire23/bootstrap/issues/7/comments","events_url":"https://api.github.com/repos/shinyquagsire23/bootstrap/issues/7/events","html_url":"https://github.com/shinyquagsire23/bootstrap/issues/7","id":60784568,"number":7,"title":"Calling SVC is not safe.","user":{"login":"173210","id":1689097,"avatar_url":"https://avatars.githubusercontent.com/u/1689097?v=3","gravatar_id":"","url":"https://api.github.com/users/173210","html_url":"https://github.com/173210","followers_url":"https://api.github.com/users/173210/followers","following_url":"https://api.github.com/users/173210/following{/other_user}","gists_url":"https://api.github.com/users/173210/gists{/gist_id}","starred_url":"https://api.github.com/users/173210/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/173210/subscriptions","organizations_url":"https://api.github.com/users/173210/orgs","repos_url":"https://api.github.com/users/173210/repos","events_url":"https://api.github.com/users/173210/events{/privacy}","received_events_url":"https://api.github.com/users/173210/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-12T08:16:08Z","updated_at":"2015-03-12T08:16:08Z","closed_at":null,"body":"We have SVC function in C with __attribute__((naked)) and inline assembly.\r\n```C\r\nint __attribute__((naked))\r\narm11_kernel_exploit_exec (int (*func)(void))\r\n{\r\n\t__asm__ (\"svc 8\\t\\n\" // CreateThread syscall, corrupted, args not needed\r\n\t\t\t \"bx lr\\t\\n\");\r\n}\r\n\r\nint __attribute__((naked))\r\narm11_kernel_execute(int (*func)(void))\r\n{\r\n\t__asm__ (\"svc #0x7B\\t\\n\"\r\n\t\t\t \"bx lr\\t\\n\");\r\n}\r\n```\r\nBut they are not safe because they can be inlined.\r\nIf inlined, the arguments will be completely ignored!\r\nWe don't have so many calls, so I suggest we remove those functions and write directly.\r\nFor example:\r\n```C\r\n__asm__(\"ldr a0, =%0\\n\"\r\n\t\"svc #8\\n\",\r\n\t: \"I\"(arm11_kernel_exploit_exec));\r\n```"}}