]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Jan 2023 10:42:18 +0000 (11:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Jan 2023 10:42:18 +0000 (11:42 +0100)
added patches:
hfsplus-fix-bug-causing-custom-uid-and-gid-being-unable-to-be-assigned-with-mount.patch

queue-4.14/hfsplus-fix-bug-causing-custom-uid-and-gid-being-unable-to-be-assigned-with-mount.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/hfsplus-fix-bug-causing-custom-uid-and-gid-being-unable-to-be-assigned-with-mount.patch b/queue-4.14/hfsplus-fix-bug-causing-custom-uid-and-gid-being-unable-to-be-assigned-with-mount.patch
new file mode 100644 (file)
index 0000000..332a102
--- /dev/null
@@ -0,0 +1,71 @@
+From 9f2b5debc07073e6dfdd774e3594d0224b991927 Mon Sep 17 00:00:00 2001
+From: Aditya Garg <gargaditya08@live.com>
+Date: Wed, 7 Dec 2022 03:05:40 +0000
+Subject: hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount
+
+From: Aditya Garg <gargaditya08@live.com>
+
+commit 9f2b5debc07073e6dfdd774e3594d0224b991927 upstream.
+
+Despite specifying UID and GID in mount command, the specified UID and GID
+were not being assigned. This patch fixes this issue.
+
+Link: https://lkml.kernel.org/r/C0264BF5-059C-45CF-B8DA-3A3BD2C803A2@live.com
+Signed-off-by: Aditya Garg <gargaditya08@live.com>
+Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/hfsplus/hfsplus_fs.h |    2 ++
+ fs/hfsplus/inode.c      |    4 ++--
+ fs/hfsplus/options.c    |    4 ++++
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+--- a/fs/hfsplus/hfsplus_fs.h
++++ b/fs/hfsplus/hfsplus_fs.h
+@@ -199,6 +199,8 @@ struct hfsplus_sb_info {
+ #define HFSPLUS_SB_HFSX               3
+ #define HFSPLUS_SB_CASEFOLD   4
+ #define HFSPLUS_SB_NOBARRIER  5
++#define HFSPLUS_SB_UID                6
++#define HFSPLUS_SB_GID                7
+ static inline struct hfsplus_sb_info *HFSPLUS_SB(struct super_block *sb)
+ {
+--- a/fs/hfsplus/inode.c
++++ b/fs/hfsplus/inode.c
+@@ -188,11 +188,11 @@ static void hfsplus_get_perms(struct ino
+       mode = be16_to_cpu(perms->mode);
+       i_uid_write(inode, be32_to_cpu(perms->owner));
+-      if (!i_uid_read(inode) && !mode)
++      if ((test_bit(HFSPLUS_SB_UID, &sbi->flags)) || (!i_uid_read(inode) && !mode))
+               inode->i_uid = sbi->uid;
+       i_gid_write(inode, be32_to_cpu(perms->group));
+-      if (!i_gid_read(inode) && !mode)
++      if ((test_bit(HFSPLUS_SB_GID, &sbi->flags)) || (!i_gid_read(inode) && !mode))
+               inode->i_gid = sbi->gid;
+       if (dir) {
+--- a/fs/hfsplus/options.c
++++ b/fs/hfsplus/options.c
+@@ -140,6 +140,8 @@ int hfsplus_parse_options(char *input, s
+                       if (!uid_valid(sbi->uid)) {
+                               pr_err("invalid uid specified\n");
+                               return 0;
++                      } else {
++                              set_bit(HFSPLUS_SB_UID, &sbi->flags);
+                       }
+                       break;
+               case opt_gid:
+@@ -151,6 +153,8 @@ int hfsplus_parse_options(char *input, s
+                       if (!gid_valid(sbi->gid)) {
+                               pr_err("invalid gid specified\n");
+                               return 0;
++                      } else {
++                              set_bit(HFSPLUS_SB_GID, &sbi->flags);
+                       }
+                       break;
+               case opt_part:
index 2383a9c501ffd954ae0d5da16a2b6ce30a6e15ce..22b1d8036ce35046d0cf37dbb82dab309319ad9a 100644 (file)
@@ -262,3 +262,4 @@ media-dvbdev-fix-refcnt-bug.patch
 powerpc-rtas-avoid-device-tree-lookups-in-rtas_os_te.patch
 powerpc-rtas-avoid-scheduling-in-rtas_os_term.patch
 hid-plantronics-additional-pids-for-double-volume-ke.patch
+hfsplus-fix-bug-causing-custom-uid-and-gid-being-unable-to-be-assigned-with-mount.patch