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

SMM_UNREG_HNDL can unregister any handler, including supervisor ones #11

Closed
kuqin12 opened this issue Aug 19, 2022 · 0 comments · Fixed by #22
Closed

SMM_UNREG_HNDL can unregister any handler, including supervisor ones #11

kuqin12 opened this issue Aug 19, 2022 · 0 comments · Fixed by #22
Assignees
Labels
impact:security Has a security impact type:bug Something isn't working

Comments

@kuqin12
Copy link
Contributor

kuqin12 commented Aug 19, 2022

The supervisor handles syscalls to register and unregister handlers on user space's behalf by exposing a SMM_REG_HNDL and SMM_UNREG_HNDL syscall. for registration it calls MmiUserHandlerRegister() to do this work, which calls CoreMmiHandlerRegister() with IsSupervisorHandler set to FALSE. For unregistering, it calls MmiHandlerUnRegister() with a user-provided handle. It performs a handle lookup and, if found, unregisters the handler. MmiHandlerUnRegister() makes no effort to see whether the handler's IsSupervisor BOOLEAN is set or not. In order words, a user-space caller can unregister a supervisor-created handler.

The impact of unregistering supervisor handler could potentially miss some events and potentially lose capability of reporting secure policy. However, security critical events will be enforced by the time external entities fetch the policy, or the OS will indicate system guard is off.

Fix recommendation:
Added a MmiUserHandlerUnRegister() function that makes sure only handlers with their IsSupervisor field set to FALSE can be unregistered through the SMM_UNREG_HNDL syscall.

Acknowledgement:
Thanks to @iljavs for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:security Has a security impact type:bug Something isn't working
Projects
None yet
2 participants