<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/overlayfs/params.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-10-10T10:00:47Z</updated>
<entry>
<title>ovl: fail if trusted xattrs are needed but caller lacks permission</title>
<updated>2024-10-10T10:00:47Z</updated>
<author>
<name>Mike Baynton</name>
</author>
<published>2024-07-11T03:52:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cea4f54ad41143ba65bb1878eb8f82d2e11f4818'/>
<id>urn:sha1:cea4f54ad41143ba65bb1878eb8f82d2e11f4818</id>
<content type='text'>
commit 6c4a5f96450415735c31ed70ff354f0ee5cbf67b upstream.

Some overlayfs features require permission to read/write trusted.*
xattrs. These include redirect_dir, verity, metacopy, and data-only
layers. This patch adds additional validations at mount time to stop
overlays from mounting in certain cases where the resulting mount would
not function according to the user's expectations because they lack
permission to access trusted.* xattrs (for example, not global root.)

Similar checks in ovl_make_workdir() that disable features instead of
failing are still relevant and used in cases where the resulting mount
can still work "reasonably well." Generally, if the feature was enabled
through kernel config or module option, any mount that worked before
will still work the same; this applies to redirect_dir and metacopy. The
user must explicitly request these features in order to generate a mount
failure. Verity and data-only layers on the other hand must be explictly
requested and have no "reasonable" disabled or degraded alternative, so
mounts attempting either always fail.

"lower data-only dirs require metacopy support" moved down in case
userxattr is set, which disables metacopy.

Cc: stable@vger.kernel.org # v6.6+
Signed-off-by: Mike Baynton &lt;mike@mbaynton.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fs_parser: move fsparam_string_empty() helper into header</title>
<updated>2024-03-26T08:01:18Z</updated>
<author>
<name>Luis Henriques (SUSE)</name>
</author>
<published>2024-03-12T10:47:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b30851a70645400ba37a184b9a2f10e1d6987a6'/>
<id>urn:sha1:7b30851a70645400ba37a184b9a2f10e1d6987a6</id>
<content type='text'>
Since both ext4 and overlayfs define the same macro to specify string
parameters that may allow empty values, define it in an header file so
that this helper can be shared.

Signed-off-by: Luis Henriques (SUSE) &lt;luis.henriques@linux.dev&gt;
Link: https://lore.kernel.org/r/20240312104757.27333-1-luis.henriques@linux.dev
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>ovl: Always reject mounting over case-insensitive directories</title>
<updated>2024-02-27T21:55:34Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2024-02-21T17:14:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2824083db76cb9d4b7910607b367e93b02912865'/>
<id>urn:sha1:2824083db76cb9d4b7910607b367e93b02912865</id>
<content type='text'>
overlayfs relies on the filesystem setting DCACHE_OP_HASH or
DCACHE_OP_COMPARE to reject mounting over case-insensitive directories.

Since commit bb9cd9106b22 ("fscrypt: Have filesystems handle their
d_ops"), we set -&gt;d_op through a hook in -&gt;d_lookup, which
means the root dentry won't have them, causing the mount to accidentally
succeed.

In v6.7-rc7, the following sequence will succeed to mount, but any
dentry other than the root dentry will be a "weird" dentry to ovl and
fail with EREMOTE.

  mkfs.ext4 -O casefold lower.img
  mount -O loop lower.img lower
  mount -t overlay -o lowerdir=lower,upperdir=upper,workdir=work ovl /mnt

Mounting on a subdirectory fails, as expected, because DCACHE_OP_HASH
and DCACHE_OP_COMPARE are properly set by -&gt;lookup.

Fix by explicitly rejecting superblocks that allow case-insensitive
dentries. Yes, this will be solved when we move d_op configuration back
to -&gt;s_d_op. Yet, we better have an explicit fix to avoid messing up
again.

While there, re-sort the entries to have more descriptive error messages
first.

Fixes: bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops")
Acked-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Reviewed-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20240221171412.10710-2-krisman@suse.de
Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@suse.de&gt;
</content>
</entry>
<entry>
<title>ovl: remove redundant ofs-&gt;indexdir member</title>
<updated>2023-11-20T07:49:09Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-11-19T18:55:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02d70090e0e020eff440dbe51e93fe2fc94d9835'/>
<id>urn:sha1:02d70090e0e020eff440dbe51e93fe2fc94d9835</id>
<content type='text'>
When the index feature is disabled, ofs-&gt;indexdir is NULL.
When the index feature is enabled, ofs-&gt;indexdir has the same value as
ofs-&gt;workdir and takes an extra reference.

This makes the code harder to understand when it is not always clear
that ofs-&gt;indexdir in one function is the same dentry as ofs-&gt;workdir
in another function.

Remove this redundancy, by referencing ofs-&gt;workdir directly in index
helpers and by using the ovl_indexdir() accessor in generic code.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: fix memory leak in ovl_parse_param()</title>
<updated>2023-11-14T06:09:36Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-11-12T08:11:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37f32f52643869131ec01bb69bdf9f404f6109fb'/>
<id>urn:sha1:37f32f52643869131ec01bb69bdf9f404f6109fb</id>
<content type='text'>
On failure to parse parameters in ovl_parse_param_lowerdir(), it is
necessary to update ctx-&gt;nr with the correct nr before using
ovl_reset_lowerdirs() to release l-&gt;name.

Reported-and-tested-by: syzbot+26eedf3631650972f17c@syzkaller.appspotmail.com
Fixes: c835110b588a ("ovl: remove unused code in lowerdir param parsing")
Co-authored-by: Edward Adam Davis &lt;eadavis@qq.com&gt;
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: add support for appending lowerdirs one by one</title>
<updated>2023-10-30T22:13:02Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-10-30T18:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24e16e385f2272b1a9df51337a5c32d28a29c7ad'/>
<id>urn:sha1:24e16e385f2272b1a9df51337a5c32d28a29c7ad</id>
<content type='text'>
Add new mount options lowerdir+ and datadir+ that can be used to add
layers to lower layers stack one by one.

Unlike the legacy lowerdir mount option, special characters (i.e. colons
and cammas) are not unescaped with these new mount options.

The new mount options can be repeated to compose a large stack of lower
layers, but they may not be mixed with the lagacy lowerdir mount option,
because for displaying lower layers in mountinfo, we do not want to mix
escaped with unescaped lower layers path syntax.

Similar to data-only layer rules with the lowerdir mount option, the
datadir+ option must follow at least one lowerdir+ option and the
lowerdir+ option must not follow the datadir+ option.

If the legacy lowerdir mount option follows lowerdir+ and datadir+
mount options, it overrides them.  Sepcifically, calling:

  fsconfig(FSCONFIG_SET_STRING, "lowerdir", "", 0);

can be used to reset previously setup lower layers.

Suggested-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Link: https://lore.kernel.org/r/CAJfpegt7VC94KkRtb1dfHG8+4OzwPBLYqhtc8=QFUxpFJE+=RQ@mail.gmail.com/
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: refactor layer parsing helpers</title>
<updated>2023-10-30T22:13:02Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-10-29T12:00:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=819829f0319a759e8a6ccb7e4f1113f3f9f07aa3'/>
<id>urn:sha1:819829f0319a759e8a6ccb7e4f1113f3f9f07aa3</id>
<content type='text'>
In preparation for new mount options to add lowerdirs one by one,
generalize ovl_parse_param_upperdir() into helper ovl_parse_layer()
that will be used for parsing a single lower layers.

Suggested-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Link: https://lore.kernel.org/r/CAJfpegt7VC94KkRtb1dfHG8+4OzwPBLYqhtc8=QFUxpFJE+=RQ@mail.gmail.com/
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: store and show the user provided lowerdir mount option</title>
<updated>2023-10-30T22:13:02Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-10-28T08:25:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0cea4c097d97fdc89de488bd4202d0b087ccec58'/>
<id>urn:sha1:0cea4c097d97fdc89de488bd4202d0b087ccec58</id>
<content type='text'>
We are about to add new mount options for adding lowerdir one by one,
but those mount options will not support escaping.

For the existing case, where lowerdir mount option is provided as a colon
separated list, store the user provided (possibly escaped) string and
display it as is when showing the lowerdir mount option.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: remove unused code in lowerdir param parsing</title>
<updated>2023-10-30T22:13:02Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-10-28T09:07:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c835110b588a750650988ca5000913c3c60d246b'/>
<id>urn:sha1:c835110b588a750650988ca5000913c3c60d246b</id>
<content type='text'>
Commit beae836e9c61 ("ovl: temporarily disable appending lowedirs")
removed the ability to append lowerdirs with syntax lowerdir=":&lt;path&gt;".
Remove leftover code and comments that are irrelevant with lowerdir
append mode disabled.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
<entry>
<title>ovl: temporarily disable appending lowedirs</title>
<updated>2023-10-14T19:42:45Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2023-10-14T19:30:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=beae836e9c61ee039e367a94b14f7fea08f0ad4c'/>
<id>urn:sha1:beae836e9c61ee039e367a94b14f7fea08f0ad4c</id>
<content type='text'>
Kernel v6.5 converted overlayfs to new mount api.
As an added bonus, it also added a feature to allow appending lowerdirs
using lowerdir=:/lower2,lowerdir=::/data3 syntax.

This new syntax has raised some concerns regarding escaping of colons.
We decided to try and disable this syntax, which hasn't been in the wild
for so long and introduce it again in 6.7 using explicit mount options
lowerdir+=/lower2,datadir+=/data3.

Suggested-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Link: https://lore.kernel.org/r/CAJfpegsr3A4YgF2YBevWa6n3=AcP7hNndG6EPMu3ncvV-AM71A@mail.gmail.com/
Fixes: b36a5780cb44 ("ovl: modify layer parameter parsing")
Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
</content>
</entry>
</feed>
