Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear caller ID on sancus_disable #8

Open
jovanbulck opened this issue Jul 15, 2017 · 1 comment
Open

Clear caller ID on sancus_disable #8

jovanbulck opened this issue Jul 15, 2017 · 1 comment
Labels

Comments

@jovanbulck
Copy link
Member

Problem. The unprotect instruction currently does not clear caller ID, which may enable an attacker controlling the continuation argument to spoof one caller authentication in multithreaded programs, without interrupting SMs:

  • thread 1: unprotected -> reader SM -> sensor SM (get data entry) -> unprotected (logging function)
  • thread 2: unprotected -> sensor SM (disable entry) -> unprotected (continuation) -> reader SM

An attacker controlling the unprotected domain suspends thread1 on the unprotected sensor SM outcall. Next, the sensor SM is disabled in thread 2 and execution continues at an unprotected continuation point (with the valid callerID of the sensor SM). At this point, the attacker simply "returns" into the reader SM, passing arbitrary spoofed return values in CPU registers. The reader SM now cannot rely anymore on sancus_get_caller_id to authenticate this return call.

Solution. After execution of the unprotect instruction, the ID of the previously executing module should be zero.

@jovanbulck jovanbulck added the bug label Jul 15, 2017
@jovanbulck
Copy link
Member Author

On the other hand, a multithreaded SM in the above scenario should of course only disable itself after it has finished all its internal execution threads.

The ID should still be cleared, however, since the continuation point could possibly be the entry point of another SM. In such a case, the continuation SM could be tricked into believing the call originated from a valid (still loaded) SM...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant