<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fscrypt.git/security/keyring.go, branch chr-fork-doc-02</title>
<subtitle>Go tool for managing Linux filesystem encryption
</subtitle>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/'/>
<entry>
<title>Add keyring package</title>
<updated>2020-01-05T18:02:13+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-12-16T03:31:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=462d166d5355d33a05271d24de4d52f30dd62f67'/>
<id>462d166d5355d33a05271d24de4d52f30dd62f67</id>
<content type='text'>
In preparation for introducing support for the new filesystem-level
keyrings, move the existing user keyring management code from
security/keyring.go and crypto/crypto.go into a new package, 'keyring'.

This package provides functions AddEncryptionKey, RemoveEncryptionKey,
and GetEncryptionKeyStatus which delegate to either the filesystem
keyring (added by a later patch) or to the user keyring.  This provides
a common interface to both types of keyrings, to the extent possible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation for introducing support for the new filesystem-level
keyrings, move the existing user keyring management code from
security/keyring.go and crypto/crypto.go into a new package, 'keyring'.

This package provides functions AddEncryptionKey, RemoveEncryptionKey,
and GetEncryptionKeyStatus which delegate to either the filesystem
keyring (added by a later patch) or to the user keyring.  This provides
a common interface to both types of keyrings, to the extent possible.
</pre>
</div>
</content>
</entry>
<entry>
<title>keyring: fix permission denied accessing user keyring (#177)</title>
<updated>2019-12-16T03:10:41+00:00</updated>
<author>
<name>ebiggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-12-16T03:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=55f71606b71f43bd64b7b4394a631f1e05e36f79'/>
<id>55f71606b71f43bd64b7b4394a631f1e05e36f79</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>Rename some variables from 'target' to 'targetUser'</title>
<updated>2019-11-27T19:40:47+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-11-27T19:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=03d3a29b70c85f083adf3c12cba60c0374f06d3e'/>
<id>03d3a29b70c85f083adf3c12cba60c0374f06d3e</id>
<content type='text'>
Refer to the target User as 'targetUser' rather than simply 'target'.
This will help avoid confusion when we add support for the filesystem
keyring, since then the Mount will also be a "target".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refer to the target User as 'targetUser' rather than simply 'target'.
This will help avoid confusion when we add support for the filesystem
keyring, since then the Mount will also be a "target".
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix various typos and grammatical errors (#141)</title>
<updated>2019-09-09T02:46:59+00:00</updated>
<author>
<name>ebiggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-09-09T02:46:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=6445dad7d66fa6a1867090fcd9602c98863649f6'/>
<id>6445dad7d66fa6a1867090fcd9602c98863649f6</id>
<content type='text'>
These were found by a combination of manual review and a custom script
that checks for common errors.

Also removed an outdated sentence from the comment for setupBefore().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were found by a combination of manual review and a custom script
that checks for common errors.

Also removed an outdated sentence from the comment for setupBefore().</pre>
</div>
</content>
</entry>
<entry>
<title>feat(spell-check): add make command for spell check.</title>
<updated>2018-09-01T19:47:27+00:00</updated>
<author>
<name>Deepesh Pathak</name>
<email>deepshpathak@gmail.com</email>
</author>
<published>2018-09-01T19:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=f270dfadb9af9e81ae4c884a3ea45ca4618a7a05'/>
<id>f270dfadb9af9e81ae4c884a3ea45ca4618a7a05</id>
<content type='text'>
* Remove spelling mistakes in the repository
* Add travis script to check for typos.
* Add command to Makefile to check for typos.
* Fixes #71
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove spelling mistakes in the repository
* Add travis script to check for typos.
* Add command to Makefile to check for typos.
* Fixes #71
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure keyring privilege changes are reversible</title>
<updated>2018-08-23T18:00:34+00:00</updated>
<author>
<name>Joe Richey joerichey@google.com</name>
<email>joerichey@google.com</email>
</author>
<published>2018-08-22T12:23:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=315f9b042237200174a1fb99427f74027e191d66'/>
<id>315f9b042237200174a1fb99427f74027e191d66</id>
<content type='text'>
This change makes sure that, when we set the ruid and euid in order to
get the user keyring linked into the current process keyring, we will
always be able to reverse these changes (using a suid of 0).

This fixes an issue where "su &lt;user&gt;" would result in a system error
when called by an unprivileged user. It also explains exactly how and
why we are making these privilege changes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change makes sure that, when we set the ruid and euid in order to
get the user keyring linked into the current process keyring, we will
always be able to reverse these changes (using a suid of 0).

This fixes an issue where "su &lt;user&gt;" would result in a system error
when called by an unprivileged user. It also explains exactly how and
why we are making these privilege changes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix lint</title>
<updated>2017-09-29T10:08:03+00:00</updated>
<author>
<name>Joseph Richey</name>
<email>joerichey94@gmail.com</email>
</author>
<published>2017-09-29T10:06:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=6f6c91993294d9bc753d22f58884dcc8e0a2f108'/>
<id>6f6c91993294d9bc753d22f58884dcc8e0a2f108</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>security: Add check option to UserKeyringID</title>
<updated>2017-09-29T09:52:56+00:00</updated>
<author>
<name>Joseph Richey</name>
<email>joerichey94@gmail.com</email>
</author>
<published>2017-09-29T09:52:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=4d9372795e7b53d105f69790c1d9deadbff85458'/>
<id>4d9372795e7b53d105f69790c1d9deadbff85458</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>security: Change user keyring lookup algorithm</title>
<updated>2017-09-01T07:53:07+00:00</updated>
<author>
<name>Joseph Richey</name>
<email>joerichey94@gmail.com</email>
</author>
<published>2017-09-01T07:53:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=1ce72a7367967152948dbe332ea8d9834f194c27'/>
<id>1ce72a7367967152948dbe332ea8d9834f194c27</id>
<content type='text'>
Now instead of spawning a seperate thread we alternate between changing
the euid and ruid to both find the keyring and link it to the process
keyring. Note that we also ensure that the user keyring is linked into
the root keyring whenever possible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now instead of spawning a seperate thread we alternate between changing
the euid and ruid to both find the keyring and link it to the process
keyring. Note that we also ensure that the user keyring is linked into
the root keyring whenever possible.
</pre>
</div>
</content>
</entry>
<entry>
<title>security: Error if privilege reset goes wrong</title>
<updated>2017-08-31T19:09:26+00:00</updated>
<author>
<name>Joe Richey</name>
<email>joerichey@google.com</email>
</author>
<published>2017-08-31T19:09:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=f1bd511fff8e411687001bd8e76e8a41c9f5ff41'/>
<id>f1bd511fff8e411687001bd8e76e8a41c9f5ff41</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
