Make ScopedHandle/HandleVerifier smarter about pseudo handles |
|
Issue descriptionPseudo-handles can't be closed, but we also don't prevent you from assigning them to a ScopedHandle, which means that the HandleVerifier can blow up on canary channel in the wild. So, we should detect pseudo-handles and either prevent the assignment, or prevent the HandleVerifier from blowing up. One really easy idea: Check if either of the bottom two bits are set in the HandleVerifier before blowing up.
,
Dec 7 2017
I'll dig around the kernel and see what I find. I see some checks for higher order bits running around with comparisons to the likes of -1. Don't all handles operate in the context of the current process anyways? CurrentProcess() is less bad in that light. CurrentThread() is interesting. Anyone passing a handle to a process in a different session would need to call DuplicateHandle on that handle anyways. |
|
►
Sign in to add a comment |
|
Comment 1 by brucedaw...@chromium.org
, Dec 7 2017