linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] ovl: don't allow datadir only
@ 2025-02-10 19:45 Miklos Szeredi
  2025-02-10 19:45 ` [PATCH 2/5] ovl: remove unused forward declaration Miklos Szeredi
                   ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: Miklos Szeredi @ 2025-02-10 19:45 UTC (permalink / raw)
  To: linux-unionfs; +Cc: Amir Goldstein, linux-fsdevel, Giuseppe Scrivano, stable

In theory overlayfs could support upper layer directly referring to a data
layer, but there's no current use case for this.

Originally, when data-only layers were introduced, this wasn't allowed,
only introduced by the "datadir+" feture, but without actually handling
this case, resuting in an Oops.

Fix by disallowing datadir without lowerdir.

Reported-by: Giuseppe Scrivano <gscrivan@redhat.com>
Fixes: 24e16e385f22 ("ovl: add support for appending lowerdirs one by one")
Cc: <stable@vger.kernel.org> # v6.7
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
---
 fs/overlayfs/super.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 86ae6f6da36b..b11094acdd8f 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1137,6 +1137,11 @@ static struct ovl_entry *ovl_get_lowerstack(struct super_block *sb,
 		return ERR_PTR(-EINVAL);
 	}
 
+	if (ctx->nr == ctx->nr_data) {
+		pr_err("at least one non-data lowerdir is required\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	err = -EINVAL;
 	for (i = 0; i < ctx->nr; i++) {
 		l = &ctx->lower[i];
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2025-03-28  9:04 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 19:45 [PATCH 1/5] ovl: don't allow datadir only Miklos Szeredi
2025-02-10 19:45 ` [PATCH 2/5] ovl: remove unused forward declaration Miklos Szeredi
2025-02-11 10:02   ` Amir Goldstein
2025-02-10 19:45 ` [PATCH 3/5] ovl: make redirect/metacopy rejection consistent Miklos Szeredi
2025-02-11 11:13   ` Amir Goldstein
2025-02-11 11:46     ` Miklos Szeredi
2025-02-11 12:00       ` Amir Goldstein
2025-02-11 12:34         ` Miklos Szeredi
2025-02-11 15:51           ` Amir Goldstein
2025-02-12 16:57             ` Miklos Szeredi
2025-02-20  9:53               ` Giuseppe Scrivano
2025-02-20 11:25                 ` Miklos Szeredi
2025-02-20 11:39                   ` Giuseppe Scrivano
2025-02-20 11:47                     ` Miklos Szeredi
2025-03-25 12:16                       ` Amir Goldstein
2025-03-27 15:28                         ` Miklos Szeredi
2025-03-27 17:13                           ` Amir Goldstein
2025-03-27 19:23                             ` Miklos Szeredi
2025-03-28  9:04                               ` Alexander Larsson
2025-03-27 22:20                             ` Colin Walters
2025-03-25 10:57         ` Miklos Szeredi
2025-03-25 11:18           ` Alexander Larsson
2025-03-25 13:34             ` Giuseppe Scrivano
2025-03-25 13:42               ` Miklos Szeredi
2025-03-25 14:16                 ` Alexander Larsson
     [not found]             ` <CAGUVWovzT=7Gj2nj-RWC9g5_KWMzPPzAbFs9-xKWpFuh8iFTiw@mail.gmail.com>
2025-03-25 14:04               ` Alexander Larsson
2025-02-10 19:45 ` [PATCH 4/5] ovl: don't require metacopy=on for lower -> data redirect Miklos Szeredi
2025-02-11 12:08   ` Amir Goldstein
2025-02-10 19:45 ` [PATCH 5/5] ovl: don't require "metacopy=on" for "verity" Miklos Szeredi
2025-02-11 10:49   ` Amir Goldstein
2025-02-11 12:14     ` Miklos Szeredi
2025-02-11 12:24       ` Amir Goldstein
2025-02-11 10:01 ` [PATCH 1/5] ovl: don't allow datadir only Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).