<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fscrypt.git/filesystem/mountpoint_test.go, branch v0.3.6</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>Compare mount by value instead of reference</title>
<updated>2024-05-02T17:47:35+00:00</updated>
<author>
<name>NymanRobin</name>
<email>robin.nyman@est.tech</email>
</author>
<published>2024-05-02T08:20:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=068b9f8f5dec46b222470f6d3f03244ba5b65f5c'/>
<id>068b9f8f5dec46b222470f6d3f03244ba5b65f5c</id>
<content type='text'>
This has to be since the mounts are reloaded
each time a mount is added. In case of two
mounts mounting at the same time there will
be a race condition for applying policy.

Signed-off-by: NymanRobin &lt;robin.nyman@est.tech&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This has to be since the mounts are reloaded
each time a mount is added. In case of two
mounts mounting at the same time there will
be a race condition for applying policy.

Signed-off-by: NymanRobin &lt;robin.nyman@est.tech&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mountpoint_test: skip TestLoadSourceDevice if loop0 doesn't exist</title>
<updated>2023-09-09T18:30:45+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2023-09-09T18:30:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=b928729b995fbbc007e47ec39a111ef059fcb29c'/>
<id>b928729b995fbbc007e47ec39a111ef059fcb29c</id>
<content type='text'>
Probably resolves https://github.com/google/fscrypt/issues/382
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Probably resolves https://github.com/google/fscrypt/issues/382
</pre>
</div>
</content>
</entry>
<entry>
<title>Stop using deprecated package io/ioutil</title>
<updated>2022-12-04T22:07:39+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-12-04T21:27:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=02875cef9010633b6689cfd1e2ceec9107b756b4'/>
<id>02875cef9010633b6689cfd1e2ceec9107b756b4</id>
<content type='text'>
Since Go 1.16 (which recently became the minimum supported Go version
for this project), the package io/ioutil is deprecated in favor of
equivalent functionality in the io and os packages.  staticcheck warns
about this.  Address all the warnings by switching to the non-deprecated
replacement functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since Go 1.16 (which recently became the minimum supported Go version
for this project), the package io/ioutil is deprecated in favor of
equivalent functionality in the io and os packages.  staticcheck warns
about this.  Address all the warnings by switching to the non-deprecated
replacement functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make the output of 'fscrypt status' unambiguous</title>
<updated>2022-02-23T20:35:04+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-02-23T20:35:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=bd380777d68816b55da85a42d4cdf7fb262b4ba2'/>
<id>bd380777d68816b55da85a42d4cdf7fb262b4ba2</id>
<content type='text'>
Following the example of /proc/self/mountinfo, replace the space,
newline, tab, and backslash characters with octal escape sequences so
that the output can be parsed unambiguously.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Following the example of /proc/self/mountinfo, replace the space,
newline, tab, and backslash characters with octal escape sequences so
that the output can be parsed unambiguously.
</pre>
</div>
</content>
</entry>
<entry>
<title>filesystem: fall back to path-only links if UUID cannot be determined</title>
<updated>2022-01-27T07:22:55+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-01-19T07:43:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=c2fb96c60d7678110bca14ff0a213243bd97cb08'/>
<id>c2fb96c60d7678110bca14ff0a213243bd97cb08</id>
<content type='text'>
This is needed to allow creating protector links to btrfs filesystems.

Update https://github.com/google/fscrypt/issues/339
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is needed to allow creating protector links to btrfs filesystems.

Update https://github.com/google/fscrypt/issues/339
</pre>
</div>
</content>
</entry>
<entry>
<title>filesystem: add back the mountsByPath map</title>
<updated>2022-01-19T19:12:37+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-01-19T07:43:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=bf17c3e80daa975ac15d6146964ca294327d8fd9'/>
<id>bf17c3e80daa975ac15d6146964ca294327d8fd9</id>
<content type='text'>
Add back the mountsByPath map, which indexes all Mounts by mountpoint.
This is needed again.

To avoid confusion, also rename two local variables named mountsByPath.

mountsByPath won't contain nil entries, so also make AllFilesystems()
use it instead of mountsByDevice.  This shouldn't change its behavior.

Update https://github.com/google/fscrypt/issues/339
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add back the mountsByPath map, which indexes all Mounts by mountpoint.
This is needed again.

To avoid confusion, also rename two local variables named mountsByPath.

mountsByPath won't contain nil entries, so also make AllFilesystems()
use it instead of mountsByDevice.  This shouldn't change its behavior.

Update https://github.com/google/fscrypt/issues/339
</pre>
</div>
</content>
</entry>
<entry>
<title>filesystem: store mountpoint in link files as a fallback</title>
<updated>2021-12-23T04:46:16+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2021-12-23T04:46:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=5ae7da4ee6582099de5d1b14733f8d58f4dc2816'/>
<id>5ae7da4ee6582099de5d1b14733f8d58f4dc2816</id>
<content type='text'>
Currently, linked protectors use filesystem link files of the form
"UUID=&lt;uuid&gt;".  These links get broken if the filesystem's UUID changes,
e.g. due to the filesystem being re-created even if the ".fscrypt"
directory is backed up and restored.

To prevent links from being broken (in most cases), start storing the
mountpoint path in the link files too, in the form
"UUID=&lt;uuid&gt;\nPATH=&lt;path&gt;\n".  When following a link, try the UUID
first, and if it doesn't work try the PATH.  While it's possible that
the path changed too, for login protectors (the usual use case of linked
protectors) this won't be an issue as the path will always be "/".

An alternative solution would be to fall back to scanning all
filesystems for the needed protector descriptor.  I decided not to do
that, since relying on a global scan doesn't seem to be a good design.
It wouldn't scale to large numbers of filesystems, it could cross
security boundaries, and it would make it possible for adding a new
filesystem to break fscrypt on existing filesystems.  And if a global
scan was an acceptable way to find protectors during normal use, then
there would be no need for link files in the first place.

Note: this change is backwards compatible (i.e., fscrypt will continue
to recognize old link files) but not forwards-compatible (i.e., previous
versions of fscrypt won't recognize new link files).

Fixes https://github.com/google/fscrypt/issues/311
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, linked protectors use filesystem link files of the form
"UUID=&lt;uuid&gt;".  These links get broken if the filesystem's UUID changes,
e.g. due to the filesystem being re-created even if the ".fscrypt"
directory is backed up and restored.

To prevent links from being broken (in most cases), start storing the
mountpoint path in the link files too, in the form
"UUID=&lt;uuid&gt;\nPATH=&lt;path&gt;\n".  When following a link, try the UUID
first, and if it doesn't work try the PATH.  While it's possible that
the path changed too, for login protectors (the usual use case of linked
protectors) this won't be an issue as the path will always be "/".

An alternative solution would be to fall back to scanning all
filesystems for the needed protector descriptor.  I decided not to do
that, since relying on a global scan doesn't seem to be a good design.
It wouldn't scale to large numbers of filesystems, it could cross
security boundaries, and it would make it possible for adding a new
filesystem to break fscrypt on existing filesystems.  And if a global
scan was an acceptable way to find protectors during normal use, then
there would be no need for link files in the first place.

Note: this change is backwards compatible (i.e., fscrypt will continue
to recognize old link files) but not forwards-compatible (i.e., previous
versions of fscrypt won't recognize new link files).

Fixes https://github.com/google/fscrypt/issues/311
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow fscrypt to work in containers (#213)</title>
<updated>2020-04-17T03:43:48+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2020-04-17T03:43:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=fe860934c793276100b7a60ebbb9325a2cfd910d'/>
<id>fe860934c793276100b7a60ebbb9325a2cfd910d</id>
<content type='text'>
Update the /proc/self/mountinfo parsing code to allow selecting a Mount
with Subtree != "/", i.e. a Mount not of the full filesystem.  This is
needed to allow fscrypt to work in containers, where the root of the
filesystem may not be mounted.

See findMainMount() for details about the algorithm used.

Resolves https://github.com/google/fscrypt/issues/211</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the /proc/self/mountinfo parsing code to allow selecting a Mount
with Subtree != "/", i.e. a Mount not of the full filesystem.  This is
needed to allow fscrypt to work in containers, where the root of the
filesystem may not be mounted.

See findMainMount() for details about the algorithm used.

Resolves https://github.com/google/fscrypt/issues/211</pre>
</div>
</content>
</entry>
<entry>
<title>Allow filesystem links to contain leading/trailing whitespace</title>
<updated>2019-11-27T19:07:38+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-11-27T19:07:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=2a45549820a4e364d000ac62362d2feafbb0b3c1'/>
<id>2a45549820a4e364d000ac62362d2feafbb0b3c1</id>
<content type='text'>
To make manually editing linked protectors slightly more user-friendly,
automatically strip any leading or trailing whitespace.  E.g. treat
"UUID=3a6d9a76-47f0-4f13-81bf-3332fbe984fb\n" the same as
"UUID=3a6d9a76-47f0-4f13-81bf-3332fbe984fb".

Update https://github.com/google/fscrypt/issues/115
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To make manually editing linked protectors slightly more user-friendly,
automatically strip any leading or trailing whitespace.  E.g. treat
"UUID=3a6d9a76-47f0-4f13-81bf-3332fbe984fb\n" the same as
"UUID=3a6d9a76-47f0-4f13-81bf-3332fbe984fb".

Update https://github.com/google/fscrypt/issues/115
</pre>
</div>
</content>
</entry>
<entry>
<title>filesystem: add unit tests for loadMountInfo()</title>
<updated>2019-10-30T16:25:38+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-10-29T07:33:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.hodgden.net/cgit.cgi/fscrypt.git/commit/?id=e71c5e4f70632b99a08d127b35e80a9e291e1938'/>
<id>e71c5e4f70632b99a08d127b35e80a9e291e1938</id>
<content type='text'>
Add a version of loadMountInfo() that takes an io.Reader parameter to
allow injecting a custom mountinfo file, then add some unit tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a version of loadMountInfo() that takes an io.Reader parameter to
allow injecting a custom mountinfo file, then add some unit tests.
</pre>
</div>
</content>
</entry>
</feed>
