How to protect a shared resource from both user processes and kernel processes simultaneously?
===

How to protect a shared resource from both user processes and kernel processes simultaneously?. It's rare and very corner case. I have been asked this query in an interview. 
TIA