islet icon indicating copy to clipboard operation
islet copied to clipboard

Enhance locking mechanism

Open bitboom opened this issue 1 year ago • 2 comments

When double-locking occurs, it is hard to detect. (just hang) One example of double-locking is that lock two granules with same address. This occurred in realm-creation test of ACS. https://github.com/Samsung/islet/pull/155

Suggestion 1

  • Add try_lock

bitboom avatar Aug 29 '23 04:08 bitboom

I think too we need this.

The best way IMO, only considering "security" not "usability" is to enforce accessing to granule inside closure, and then, make sure that no APIs to lock again are exposed within the closure. But, this is not a usable solution, as we may unnecessarily fall into nested closures.

So, I think too try_lock is a way to go. Plus, when we deal with this, we may also need to take into account "dead-lock" prevention.

jinbpark avatar Aug 29 '23 05:08 jinbpark

what do you mean by locking two (distinct) granules with the same address?

bokdeuk-jeong avatar Aug 31 '23 12:08 bokdeuk-jeong