]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2024 13:09:38 +0000 (15:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2024 13:09:38 +0000 (15:09 +0200)
added patches:
ovl-do-not-fail-because-of-o_noatime.patch

queue-5.10/ovl-do-not-fail-because-of-o_noatime.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/ovl-do-not-fail-because-of-o_noatime.patch b/queue-5.10/ovl-do-not-fail-because-of-o_noatime.patch
new file mode 100644 (file)
index 0000000..0c3f29d
--- /dev/null
@@ -0,0 +1,50 @@
+From b6650dab404c701d7fe08a108b746542a934da84 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <mszeredi@redhat.com>
+Date: Mon, 14 Dec 2020 15:26:14 +0100
+Subject: ovl: do not fail because of O_NOATIME
+
+From: Miklos Szeredi <mszeredi@redhat.com>
+
+commit b6650dab404c701d7fe08a108b746542a934da84 upstream.
+
+In case the file cannot be opened with O_NOATIME because of lack of
+capabilities, then clear O_NOATIME instead of failing.
+
+Remove WARN_ON(), since it would now trigger if O_NOATIME was cleared.
+Noticed by Amir Goldstein.
+
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/overlayfs/file.c |   11 +++--------
+ 1 file changed, 3 insertions(+), 8 deletions(-)
+
+--- a/fs/overlayfs/file.c
++++ b/fs/overlayfs/file.c
+@@ -53,9 +53,10 @@ static struct file *ovl_open_realfile(co
+       err = inode_permission(realinode, MAY_OPEN | acc_mode);
+       if (err) {
+               realfile = ERR_PTR(err);
+-      } else if (!inode_owner_or_capable(realinode)) {
+-              realfile = ERR_PTR(-EPERM);
+       } else {
++              if (!inode_owner_or_capable(realinode))
++                      flags &= ~O_NOATIME;
++
+               realfile = open_with_fake_path(&file->f_path, flags, realinode,
+                                              current_cred());
+       }
+@@ -75,12 +76,6 @@ static int ovl_change_flags(struct file
+       struct inode *inode = file_inode(file);
+       int err;
+-      flags |= OVL_OPEN_FLAGS;
+-
+-      /* If some flag changed that cannot be changed then something's amiss */
+-      if (WARN_ON((file->f_flags ^ flags) & ~OVL_SETFL_MASK))
+-              return -EIO;
+-
+       flags &= OVL_SETFL_MASK;
+       if (((flags ^ file->f_flags) & O_APPEND) && IS_APPEND(inode))
index f10de852a426e54e025af711de9c7acd953426b1..695ffd1b6b9c5ccfb5cac021417366aeeb86d041 100644 (file)
@@ -133,3 +133,4 @@ revert-input-ioc3kbd-convert-to-platform-remove-callback-returning-void.patch
 ata-libata-core-fix-null-pointer-dereference-on-error.patch
 cgroup-cpuset-prevent-uaf-in-proc_cpuset_show.patch
 net-rds-fix-possible-deadlock-in-rds_message_put.patch
+ovl-do-not-fail-because-of-o_noatime.patch