aboutsummaryrefslogtreecommitdiff
path: root/actions/config.go
diff options
context:
space:
mode:
authorebiggers <ebiggers@google.com>2019-12-15 19:10:41 -0800
committerJoseph Richey <joerichey@google.com>2019-12-15 19:10:41 -0800
commit55f71606b71f43bd64b7b4394a631f1e05e36f79 (patch)
treeada151a1cf689e5e0e865929dcf58d30918ba376 /actions/config.go
parent6821d90d7c449b63d602c272d5ffa19243a7c517 (diff)
keyring: fix permission denied accessing user keyring (#177)
When userKeyringIDLookup() looks up a user keyring, it links it into the process keyring to ensure that the process retains the "possessor privileges" over the user keyring, then caches the user keyring's ID. Unfortunately, this use of the process keyring randomly fails because Go creates threads before even init() and main() are run, and then can run code on them later. Since the kernel doesn't create the process keyring until userspace requests it and the process keyring is actually a per-thread property that's only inherited by new threads, different threads in a Go process may see different process keyrings. Fix this by removing the user keyring cache, switching from the process keyring to the thread keyring, and using LockOSThread() to pin the goroutine to an OS thread while needed to perform a keyring operation. Resolves https://github.com/google/fscrypt/issues/176
Diffstat (limited to 'actions/config.go')
0 files changed, 0 insertions, 0 deletions