From 2242fbf2b9b1cd9bab1e42534429c536255efffd Mon Sep 17 00:00:00 2001 From: Evgenii Shatokhin Date: Tue, 16 Jul 2019 19:03:29 +0300 Subject: [PATCH] Updated AUFS to version 5.1-20190610 --- fs-aufs4.patch => fs-aufs.patch | 439 +++++++++++++++----------------- kernel.spec | 2 +- 2 files changed, 204 insertions(+), 237 deletions(-) rename fs-aufs4.patch => fs-aufs.patch (99%) diff --git a/fs-aufs4.patch b/fs-aufs.patch similarity index 99% rename from fs-aufs4.patch rename to fs-aufs.patch index 6ba9df6..fd1c509 100644 --- a/fs-aufs4.patch +++ b/fs-aufs.patch @@ -98,12 +98,12 @@ index 000000000000..82f9518495ea + will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README new file mode 100644 -index 000000000000..fb05e3b722ea +index 000000000000..6e6774fbf602 --- /dev/null +++ b/Documentation/filesystems/aufs/README -@@ -0,0 +1,395 @@ +@@ -0,0 +1,399 @@ + -+Aufs4 -- advanced multi layered unification filesystem version 4.x ++Aufs5 -- advanced multi layered unification filesystem version 5.x +http://aufs.sf.net +Junjiro R. Okajima + @@ -112,16 +112,19 @@ index 000000000000..fb05e3b722ea +---------------------------------------- +In the early days, aufs was entirely re-designed and re-implemented +Unionfs Version 1.x series. Adding many original ideas, approaches, -+improvements and implementations, it becomes totally different from ++improvements and implementations, it became totally different from +Unionfs while keeping the basic features. -+Recently, Unionfs Version 2.x series begin taking some of the same ++Later, Unionfs Version 2.x series began taking some of the same +approaches to aufs1's. -+Unionfs is being developed by Professor Erez Zadok at Stony Brook ++Unionfs was being developed by Professor Erez Zadok at Stony Brook +University and his team. + -+Aufs4 supports linux-4.0 and later, and for linux-3.x series try aufs3. -+If you want older kernel version support, try aufs2-2.6.git or -+aufs2-standalone.git repository, aufs1 from CVS on SourceForge. ++Aufs5 supports linux-v5.0 and later, If you want older kernel version ++support, ++- for linux-v4.x series, try aufs4-linux.git or aufs4-standalone.git ++- for linux-v3.x series, try aufs3-linux.git or aufs3-standalone.git ++- for linux-v2.6.16 and later, try aufs2-2.6.git, aufs2-standalone.git ++ or aufs1 from CVS on SourceForge. + +Note: it becomes clear that "Aufs was rejected. Let's give it up." + According to Christoph Hellwig, linux rejects all union-type @@ -181,7 +184,7 @@ index 000000000000..fb05e3b722ea +- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX. +- and more... + -+Currently these features are dropped temporary from aufs4. ++Currently these features are dropped temporary from aufs5. +See design/08plan.txt in detail. +- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs + (robr) @@ -199,64 +202,64 @@ index 000000000000..fb05e3b722ea + +2. Download +---------------------------------------- -+There are three GIT trees for aufs4, aufs4-linux.git, -+aufs4-standalone.git, and aufs-util.git. Note that there is no "4" in ++There are three GIT trees for aufs5, aufs5-linux.git, ++aufs5-standalone.git, and aufs-util.git. Note that there is no "5" in +"aufs-util.git." -+While the aufs-util is always necessary, you need either of aufs4-linux -+or aufs4-standalone. ++While the aufs-util is always necessary, you need either of aufs5-linux ++or aufs5-standalone. + -+The aufs4-linux tree includes the whole linux mainline GIT tree, ++The aufs5-linux tree includes the whole linux mainline GIT tree, +git://git.kernel.org/.../torvalds/linux.git. +And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot -+build aufs4 as an external kernel module. ++build aufs5 as an external kernel module. +Several extra patches are not included in this tree. Only -+aufs4-standalone tree contains them. They are described in the later ++aufs5-standalone tree contains them. They are described in the later +section "Configuration and Compilation." + -+On the other hand, the aufs4-standalone tree has only aufs source files ++On the other hand, the aufs5-standalone tree has only aufs source files +and necessary patches, and you can select CONFIG_AUFS_FS=m. +But you need to apply all aufs patches manually. + -+You will find GIT branches whose name is in form of "aufs4.x" where "x" -+represents the linux kernel version, "linux-4.x". For instance, -+"aufs4.0" is for linux-4.0. For latest "linux-4.x-rcN", use -+"aufs4.x-rcN" branch. ++You will find GIT branches whose name is in form of "aufs5.x" where "x" ++represents the linux kernel version, "linux-5.x". For instance, ++"aufs5.0" is for linux-5.0. For latest "linux-5.x-rcN", use ++"aufs5.x-rcN" branch. + -+o aufs4-linux tree ++o aufs5-linux tree +$ git clone --reference /your/linux/git/tree \ -+ git://github.com/sfjro/aufs4-linux.git aufs4-linux.git ++ git://github.com/sfjro/aufs5-linux.git aufs5-linux.git +- if you don't have linux GIT tree, then remove "--reference ..." -+$ cd aufs4-linux.git -+$ git checkout origin/aufs4.0 ++$ cd aufs5-linux.git ++$ git checkout origin/aufs5.0 + +Or You may want to directly git-pull aufs into your linux GIT tree, and +leave the patch-work to GIT. +$ cd /your/linux/git/tree -+$ git remote add aufs4 git://github.com/sfjro/aufs4-linux.git -+$ git fetch aufs4 -+$ git checkout -b my4.0 v4.0 ++$ git remote add aufs5 git://github.com/sfjro/aufs5-linux.git ++$ git fetch aufs5 ++$ git checkout -b my5.0 v5.0 +$ (add your local change...) -+$ git pull aufs4 aufs4.0 -+- now you have v4.0 + your_changes + aufs4.0 in you my4.0 branch. ++$ git pull aufs5 aufs5.0 ++- now you have v5.0 + your_changes + aufs5.0 in you my5.0 branch. +- you may need to solve some conflicts between your_changes and -+ aufs4.0. in this case, git-rerere is recommended so that you can -+ solve the similar conflicts automatically when you upgrade to 4.1 or ++ aufs5.0. in this case, git-rerere is recommended so that you can ++ solve the similar conflicts automatically when you upgrade to 5.1 or + later in the future. + -+o aufs4-standalone tree -+$ git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git -+$ cd aufs4-standalone.git -+$ git checkout origin/aufs4.0 ++o aufs5-standalone tree ++$ git clone git://github.com/sfjro/aufs5-standalone.git aufs5-standalone.git ++$ cd aufs5-standalone.git ++$ git checkout origin/aufs5.0 + +o aufs-util tree +$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git +- note that the public aufs-util.git is on SourceForge instead of + GitHUB. +$ cd aufs-util.git -+$ git checkout origin/aufs4.0 ++$ git checkout origin/aufs5.0 + -+Note: The 4.x-rcN branch is to be used with `rc' kernel versions ONLY. -+The minor version number, 'x' in '4.x', of aufs may not always ++Note: The 5.x-rcN branch is to be used with `rc' kernel versions ONLY. ++The minor version number, 'x' in '5.x', of aufs may not always +follow the minor version number of the kernel. +Because changes in the kernel that cause the use of a new +minor version number do not always require changes to aufs-util. @@ -268,8 +271,8 @@ index 000000000000..fb05e3b722ea +nearest lower number. + +For (an unreleased) example: -+If you are using "linux-4.10" and the "aufs4.10" branch -+does not exist in aufs-util repository, then "aufs4.9", "aufs4.8" ++If you are using "linux-5.10" and the "aufs5.10" branch ++does not exist in aufs-util repository, then "aufs5.9", "aufs5.8" +or something numerically smaller is the branch for your kernel. + +Also you can view all branches by @@ -280,28 +283,25 @@ index 000000000000..fb05e3b722ea +---------------------------------------- +Make sure you have git-checkout'ed the correct branch. + -+For aufs4-linux tree, ++For aufs5-linux tree, +- enable CONFIG_AUFS_FS. +- set other aufs configurations if necessary. + -+For aufs4-standalone tree, ++For aufs5-standalone tree, +There are several ways to build. + +1. -+- apply ./aufs4-kbuild.patch to your kernel source files. -+- apply ./aufs4-base.patch too. -+- apply ./aufs4-mmap.patch too. -+- apply ./aufs4-standalone.patch too, if you have a plan to set -+ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs4-standalone.patch. ++- apply ./aufs5-kbuild.patch to your kernel source files. ++- apply ./aufs5-base.patch too. ++- apply ./aufs5-mmap.patch too. ++- apply ./aufs5-standalone.patch too, if you have a plan to set ++ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs5-standalone.patch. +- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your + kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild. +- enable CONFIG_AUFS_FS, you can select either + =m or =y. +- and build your kernel as usual. +- install the built kernel. -+ Note: Since linux-3.9, every filesystem module requires an alias -+ "fs-". You should make sure that "fs-aufs" is listed in your -+ modules.aliases file if you set CONFIG_AUFS_FS=m. +- install the header files too by "make headers_install" to the + directory where you specify. By default, it is $PWD/usr. + "make help" shows a brief note for headers_install. @@ -309,17 +309,14 @@ index 000000000000..fb05e3b722ea + +2. +- module only (CONFIG_AUFS_FS=m). -+- apply ./aufs4-base.patch to your kernel source files. -+- apply ./aufs4-mmap.patch too. -+- apply ./aufs4-standalone.patch too. ++- apply ./aufs5-base.patch to your kernel source files. ++- apply ./aufs5-mmap.patch too. ++- apply ./aufs5-standalone.patch too. +- build your kernel, don't forget "make headers_install", and reboot. +- edit ./config.mk and set other aufs configurations if necessary. + Note: You should read $PWD/fs/aufs/Kconfig carefully which describes + every aufs configurations. +- build the module by simple "make". -+ Note: Since linux-3.9, every filesystem module requires an alias -+ "fs-". You should make sure that "fs-aufs" is listed in your -+ modules.aliases file. +- you can specify ${KDIR} make variable which points to your kernel + source tree. +- install the files @@ -330,7 +327,7 @@ index 000000000000..fb05e3b722ea + available in aufs standalone version's Makefile only), or copy + $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever + you like manually. By default, the target directory is $PWD/usr. -+- no need to apply aufs4-kbuild.patch, nor copying source files to your ++- no need to apply aufs5-kbuild.patch, nor copying source files to your + kernel source tree. + +Note: The header file aufs_type.h is necessary to build aufs-util @@ -350,12 +347,19 @@ index 000000000000..fb05e3b722ea + then run "make install_ulib" too. And refer to the aufs manual in + detail. + -+There several other patches in aufs4-standalone.git. They are all ++There several other patches in aufs5-standalone.git. They are all +optional. When you meet some problems, they will help you. -+- aufs4-loopback.patch ++- aufs5-loopback.patch + Supports a nested loopback mount in a branch-fs. This patch is + unnecessary until aufs produces a message like "you may want to try + another patch for loopback file". ++- proc_mounts.patch ++ When there are many mountpoints and many mount(2)/umount(2) are ++ running, then /proc/mounts may not show the all mountpoints. This ++ patch makes /proc/mounts always show the full mountpoints list. ++ If you don't want to apply this patch and meet such problem, then you ++ need to increase the value of 'ProcMounts_Times' make-variable in ++ aufs-util.git as a second best solution. +- vfs-ino.patch + Modifies a system global kernel internal function get_next_ino() in + order to stop assigning 0 for an inode-number. Not directly related to @@ -372,7 +376,7 @@ index 000000000000..fb05e3b722ea + the internal locks for LOCKDEP is necessary. LOCKDEP is a debugging + feature of linux kernel. If you enable CONFIG_LOCKDEP, then you will + need to apply this debug patch to expand several constant values. -+ If don't know what LOCKDEP, then you don't have apply this patch. ++ If don't know what LOCKDEP is, then you don't have apply this patch. + + +4. Usage @@ -1925,10 +1929,10 @@ index 000000000000..13e8583f2b91 +Currently this approach is applied to address_space_operations for +regular files only. diff --git a/MAINTAINERS b/MAINTAINERS -index dce5c099f43c..d10f05c88860 100644 +index 2c2fce72e694..f5be2663b01e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -2635,6 +2635,19 @@ F: include/linux/audit.h +@@ -2699,6 +2699,19 @@ F: include/linux/audit.h F: include/uapi/linux/audit.h F: kernel/audit* @@ -1949,7 +1953,7 @@ index dce5c099f43c..d10f05c88860 100644 M: Miguel Ojeda Sandonis S: Maintained diff --git a/drivers/block/loop.c b/drivers/block/loop.c -index 9a8d83bc1e75..c5e144b8d20c 100644 +index bf1c61cab8eb..7e18c8c72dcc 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -738,6 +738,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, @@ -1978,22 +1982,22 @@ index 9a8d83bc1e75..c5e144b8d20c 100644 static ssize_t loop_attr_show(struct device *dev, char *page, diff --git a/fs/Kconfig b/fs/Kconfig -index ac474a61be37..284cee954591 100644 +index db921dc267d3..80d6394abafc 100644 --- a/fs/Kconfig +++ b/fs/Kconfig -@@ -255,6 +255,7 @@ source "fs/pstore/Kconfig" +@@ -260,6 +260,7 @@ source "fs/romfs/Kconfig" + source "fs/pstore/Kconfig" source "fs/sysv/Kconfig" source "fs/ufs/Kconfig" - source "fs/exofs/Kconfig" +source "fs/aufs/Kconfig" endif # MISC_FILESYSTEMS diff --git a/fs/Makefile b/fs/Makefile -index 293733f61594..12d19d0de07a 100644 +index 427fec226fae..e5ec0a044931 100644 --- a/fs/Makefile +++ b/fs/Makefile -@@ -128,3 +128,4 @@ obj-y += exofs/ # Multiple modules +@@ -129,3 +129,4 @@ obj-$(CONFIG_F2FS_FS) += f2fs/ obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ @@ -2325,10 +2329,10 @@ index 000000000000..a62a85211b88 +#endif /* __AUFS_H__ */ diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c new file mode 100644 -index 000000000000..598cf370a1dc +index 000000000000..fb388a049940 --- /dev/null +++ b/fs/aufs/branch.c -@@ -0,0 +1,1422 @@ +@@ -0,0 +1,1423 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2005-2019 Junjiro R. Okajima @@ -3458,6 +3462,7 @@ index 000000000000..598cf370a1dc + + err = copy_from_user(&ibusy, arg, sizeof(ibusy)); + if (!err) ++ /* VERIFY_WRITE */ + err = !access_ok(&arg->h_ino, sizeof(arg->h_ino)); + if (unlikely(err)) { + err = -EFAULT; @@ -3753,10 +3758,10 @@ index 000000000000..598cf370a1dc +} diff --git a/fs/aufs/branch.h b/fs/aufs/branch.h new file mode 100644 -index 000000000000..f99063aa54cd +index 000000000000..012459ad57f3 --- /dev/null +++ b/fs/aufs/branch.h -@@ -0,0 +1,365 @@ +@@ -0,0 +1,366 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2005-2019 Junjiro R. Okajima @@ -3984,7 +3989,8 @@ index 000000000000..f99063aa54cd +static const loff_t au_loff_max = LLONG_MAX; + +aufs_bindex_t au_xi_root(struct super_block *sb, struct dentry *dentry); -+struct file *au_xino_create(struct super_block *sb, char *fpath, int silent); ++struct file *au_xino_create(struct super_block *sb, char *fpath, int silent, ++ int wbrtop); +struct file *au_xino_create2(struct super_block *sb, struct path *base, + struct file *copy_src); +struct au_xi_new { @@ -11755,10 +11761,10 @@ index 000000000000..a986736462c3 +#endif /* __AUFS_DIRREN_H__ */ diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c new file mode 100644 -index 000000000000..06c558367944 +index 000000000000..ed79f8255a8f --- /dev/null +++ b/fs/aufs/dynop.c -@@ -0,0 +1,370 @@ +@@ -0,0 +1,367 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2010-2019 Junjiro R. Okajima @@ -11801,8 +11807,8 @@ index 000000000000..06c558367944 + hlist_bl_lock(hbl); + hlist_bl_for_each_entry(tmp, pos, hbl, dk_hnode) + if (tmp->dk_op.dy_hop == h_op) { -+ key = tmp; -+ kref_get(&key->dk_kref); ++ if (kref_get_unless_zero(&tmp->dk_kref)) ++ key = tmp; + break; + } + hlist_bl_unlock(hbl); @@ -11856,8 +11862,8 @@ index 000000000000..06c558367944 + hlist_bl_lock(hbl); + hlist_bl_for_each_entry(tmp, pos, hbl, dk_hnode) + if (tmp->dk_op.dy_hop == h_op) { -+ kref_get(&tmp->dk_kref); -+ found = tmp; ++ if (kref_get_unless_zero(&tmp->dk_kref)) ++ found = tmp; + break; + } + if (!found) @@ -11875,7 +11881,7 @@ index 000000000000..06c558367944 + + key = container_of(rcu, struct au_dykey, dk_rcu); + DyPrSym(key); -+ au_kfree_rcu(key); ++ kfree(key); +} + +static void dy_free(struct kref *kref) @@ -12115,9 +12121,6 @@ index 000000000000..06c558367944 +{ + int i; + -+ /* make sure that 'struct au_dykey *' can be any type */ -+ BUILD_BUG_ON(offsetof(struct au_dyaop, da_key)); -+ + for (i = 0; i < AuDyLast; i++) + INIT_HLIST_BL_HEAD(dynop + i); +} @@ -12131,10 +12134,10 @@ index 000000000000..06c558367944 +} diff --git a/fs/aufs/dynop.h b/fs/aufs/dynop.h new file mode 100644 -index 000000000000..f3301c2a6a9b +index 000000000000..5d0b36559425 --- /dev/null +++ b/fs/aufs/dynop.h -@@ -0,0 +1,75 @@ +@@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2010-2019 Junjiro R. Okajima @@ -12194,6 +12197,8 @@ index 000000000000..f3301c2a6a9b + struct au_dykey da_key; + struct address_space_operations da_op; /* not const */ +}; ++/* make sure that 'struct au_dykey *' can be any type */ ++static_assert(!offsetof(struct au_dyaop, da_key)); + +/* ---------------------------------------------------------------------- */ + @@ -16525,7 +16530,7 @@ index 000000000000..3bd869a69c8f +} diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c new file mode 100644 -index 000000000000..95bced39c290 +index 000000000000..2c1bb556a716 --- /dev/null +++ b/fs/aufs/hnotify.c @@ -0,0 +1,721 @@ @@ -17116,7 +17121,7 @@ index 000000000000..95bced39c290 + flags[AuHn_CHILD] = AuHnJob_ISDIR; + au_fset_hnjob(flags[AuHn_PARENT], DIRENT); + au_fset_hnjob(flags[AuHn_CHILD], GEN); -+ switch (mask & FS_EVENTS_POSS_ON_CHILD) { ++ switch (mask & ALL_FSNOTIFY_DIRENT_EVENTS) { + case FS_MOVED_FROM: + case FS_MOVED_TO: + au_fset_hnjob(flags[AuHn_CHILD], XINO0); @@ -23431,7 +23436,7 @@ index 000000000000..d8508f875f28 +#endif /* __AUFS_LCNT_H__ */ diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c new file mode 100644 -index 000000000000..cef7d96362c7 +index 000000000000..bfcb9f994c2d --- /dev/null +++ b/fs/aufs/loop.c @@ -0,0 +1,148 @@ @@ -23566,7 +23571,7 @@ index 000000000000..cef7d96362c7 + int err; + struct super_block *sb __maybe_unused; + -+ BUILD_BUG_ON(sizeof(sb->s_magic) != sizeof(unsigned long)); ++ BUILD_BUG_ON(sizeof(sb->s_magic) != sizeof(*au_warn_loopback_array)); + + err = 0; + au_warn_loopback_array = kcalloc(au_warn_loopback_step, @@ -23585,7 +23590,7 @@ index 000000000000..cef7d96362c7 +} diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h new file mode 100644 -index 000000000000..625bd78d99af +index 000000000000..7fc394e72d75 --- /dev/null +++ b/fs/aufs/loop.h @@ -0,0 +1,55 @@ @@ -23631,7 +23636,7 @@ index 000000000000..625bd78d99af +int au_loopback_init(void); +void au_loopback_fin(void); +#else -+AuStub(struct file *, loop_backing_file, return NULL) ++AuStub(struct file *, loop_backing_file, return NULL, struct super_block *sb) + +AuStubInt0(au_test_loopback_overlap, struct super_block *sb, + struct dentry *h_adding) @@ -24134,10 +24139,10 @@ index 000000000000..3036754b90d0 +#endif /* __AUFS_MODULE_H__ */ diff --git a/fs/aufs/mvdown.c b/fs/aufs/mvdown.c new file mode 100644 -index 000000000000..59ce2d700ec9 +index 000000000000..cbac849ead31 --- /dev/null +++ b/fs/aufs/mvdown.c -@@ -0,0 +1,705 @@ +@@ -0,0 +1,706 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2011-2019 Junjiro R. Okajima @@ -24783,6 +24788,7 @@ index 000000000000..59ce2d700ec9 + + err = copy_from_user(&args->mvdown, uarg, sizeof(args->mvdown)); + if (!err) ++ /* VERIFY_WRITE */ + err = !access_ok(uarg, sizeof(*uarg)); + if (unlikely(err)) { + err = -EFAULT; @@ -24845,7 +24851,7 @@ index 000000000000..59ce2d700ec9 +} diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c new file mode 100644 -index 000000000000..1cd07cd30320 +index 000000000000..c92ca14574ff --- /dev/null +++ b/fs/aufs/opts.c @@ -0,0 +1,1877 @@ @@ -25769,7 +25775,7 @@ index 000000000000..1cd07cd30320 + int err; + struct file *file; + -+ file = au_xino_create(sb, args[0].from, /*silent*/0); ++ file = au_xino_create(sb, args[0].from, /*silent*/0, /*wbrtop*/0); + err = PTR_ERR(file); + if (IS_ERR(file)) + goto out; @@ -27647,7 +27653,7 @@ index 000000000000..67a4bbffdf5f +} diff --git a/fs/aufs/procfs.c b/fs/aufs/procfs.c new file mode 100644 -index 000000000000..29c6377e888c +index 000000000000..582dd486fcd3 --- /dev/null +++ b/fs/aufs/procfs.c @@ -0,0 +1,171 @@ @@ -27714,8 +27720,8 @@ index 000000000000..29c6377e888c + hlist_bl_lock(&au_sbilist); + hlist_bl_for_each_entry(sbinfo, pos, &au_sbilist, si_list) + if (id == sysaufs_si_id(sbinfo)) { -+ kobject_get(&sbinfo->si_kobj); -+ sb = sbinfo->si_sb; ++ if (kobject_get_unless_zero(&sbinfo->si_kobj)) ++ sb = sbinfo->si_sb; + break; + } + hlist_bl_unlock(&au_sbilist); @@ -27824,10 +27830,10 @@ index 000000000000..29c6377e888c +} diff --git a/fs/aufs/rdu.c b/fs/aufs/rdu.c new file mode 100644 -index 000000000000..bf0233a2887d +index 000000000000..3805e79627eb --- /dev/null +++ b/fs/aufs/rdu.c -@@ -0,0 +1,382 @@ +@@ -0,0 +1,384 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2005-2019 Junjiro R. Okajima @@ -27964,6 +27970,7 @@ index 000000000000..bf0233a2887d + struct file *h_file; + struct au_rdu_cookie *cookie = &rdu->cookie; + ++ /* VERIFY_WRITE */ + err = !access_ok(rdu->ent.e, rdu->sz); + if (unlikely(err)) { + err = -EFAULT; @@ -28070,6 +28077,7 @@ index 000000000000..bf0233a2887d + /* unnecessary to support mmap_sem since this is a dir */ + err = copy_from_user(&ent, u->e, sizeof(ent)); + if (!err) ++ /* VERIFY_WRITE */ + err = !access_ok(&u->e->ino, sizeof(ino)); + if (unlikely(err)) { + err = -EFAULT; @@ -29666,7 +29674,7 @@ index 000000000000..bcb0b26fdfbe +}; diff --git a/fs/aufs/super.h b/fs/aufs/super.h new file mode 100644 -index 000000000000..74571acf3eb9 +index 000000000000..37f02bb21324 --- /dev/null +++ b/fs/aufs/super.h @@ -0,0 +1,589 @@ @@ -30110,7 +30118,7 @@ index 000000000000..74571acf3eb9 + +/* current->atomic_flags */ +/* this value should never corrupt the ones defined in linux/sched.h */ -+#define PFA_AUFS 7 ++#define PFA_AUFS 0x10 + +TASK_PFA_TEST(AUFS, test_aufs) /* task_test_aufs */ +TASK_PFA_SET(AUFS, aufs) /* task_set_aufs */ @@ -30468,10 +30476,10 @@ index 000000000000..195fe279b820 +#endif /* __SYSAUFS_H__ */ diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c new file mode 100644 -index 000000000000..927f6b252c75 +index 000000000000..eda987628dbb --- /dev/null +++ b/fs/aufs/sysfs.c -@@ -0,0 +1,373 @@ +@@ -0,0 +1,374 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2005-2019 Junjiro R. Okajima @@ -30721,6 +30729,7 @@ index 000000000000..927f6b252c75 + + sz = sizeof(*arg) - offsetof(union aufs_brinfo, path); + for (bindex = 0; bindex <= bbot; bindex++, arg++) { ++ /* VERIFY_WRITE */ + err = !access_ok(arg, sizeof(*arg)); + if (unlikely(err)) + break; @@ -36034,10 +36043,10 @@ index 000000000000..8e56b15c53b5 +} diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c new file mode 100644 -index 000000000000..7733b9a28779 +index 000000000000..35ea33469d36 --- /dev/null +++ b/fs/aufs/xino.c -@@ -0,0 +1,1956 @@ +@@ -0,0 +1,1965 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2005-2019 Junjiro R. Okajima @@ -36200,22 +36209,28 @@ index 000000000000..7733b9a28779 +/* + * create and set a new xino file + */ -+struct file *au_xino_create(struct super_block *sb, char *fpath, int silent) ++struct file *au_xino_create(struct super_block *sb, char *fpath, int silent, ++ int wbrtop) +{ + struct file *file; + struct dentry *h_parent, *d; + struct inode *h_dir, *inode; + int err; ++ static DEFINE_MUTEX(mtx); + + /* + * at mount-time, and the xino file is the default path, + * hnotify is disabled so we have no notify events to ignore. + * when a user specified the xino, we cannot get au_hdir to be ignored. + */ ++ if (!wbrtop) ++ mutex_lock(&mtx); + file = vfsub_filp_open(fpath, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE + /* | __FMODE_NONOTIFY */, + 0666); + if (IS_ERR(file)) { ++ if (!wbrtop) ++ mutex_unlock(&mtx); + if (!silent) + pr_err("open %s(%ld)\n", fpath, PTR_ERR(file)); + return file; @@ -36225,6 +36240,8 @@ index 000000000000..7733b9a28779 + err = 0; + d = file->f_path.dentry; + h_parent = au_dget_parent_lock(d, AuLsc_I_PARENT); ++ if (!wbrtop) ++ mutex_unlock(&mtx); + /* mnt_want_write() is unnecessary here */ + h_dir = d_inode(h_parent); + inode = file_inode(file); @@ -37707,11 +37724,12 @@ index 000000000000..7733b9a28779 + if (!IS_ERR(p)) { + strcat(p, "/" AUFS_XINO_FNAME); + AuDbg("%s\n", p); -+ file = au_xino_create(sb, p, /*silent*/0); ++ file = au_xino_create(sb, p, /*silent*/0, /*wbrtop*/1); + } + free_page((unsigned long)page); + } else { -+ file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0); ++ file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0, ++ /*wbrtop*/0); + if (IS_ERR(file)) + goto out; + h_sb = file->f_path.dentry->d_sb; @@ -37995,7 +38013,7 @@ index 000000000000..7733b9a28779 + return err; +} diff --git a/fs/dcache.c b/fs/dcache.c -index aac41adf4743..50eb587c1253 100644 +index c663c602f9ef..b9771d9b5d46 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1247,7 +1247,7 @@ enum d_walk_ret { @@ -38015,7 +38033,7 @@ index aac41adf4743..50eb587c1253 100644 struct check_mount { struct vfsmount *mnt; -@@ -2845,6 +2846,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2) +@@ -2847,6 +2848,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2) write_sequnlock(&rename_lock); } @@ -38024,7 +38042,7 @@ index aac41adf4743..50eb587c1253 100644 /** * d_ancestor - search for an ancestor diff --git a/fs/exec.c b/fs/exec.c -index bcf383730bea..a97bdea3622e 100644 +index 2e0033348d8e..bd946a5b9b1e 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -109,6 +109,7 @@ bool path_noexec(const struct path *path) @@ -38066,7 +38084,7 @@ index 083185174c6d..2072f690b121 100644 static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, int force) diff --git a/fs/file_table.c b/fs/file_table.c -index 5679e7fcb6b0..961eec3df1eb 100644 +index 155d7514a094..eefcbb908038 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -161,6 +161,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred) @@ -38085,7 +38103,7 @@ index 5679e7fcb6b0..961eec3df1eb 100644 static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput); -@@ -365,6 +367,7 @@ void __fput_sync(struct file *file) +@@ -370,6 +372,7 @@ void __fput_sync(struct file *file) } EXPORT_SYMBOL(fput); @@ -38094,7 +38112,7 @@ index 5679e7fcb6b0..961eec3df1eb 100644 void __init files_init(void) { diff --git a/fs/inode.c b/fs/inode.c -index 73432e64f874..572126ca5160 100644 +index 5bd1dd2e942f..b2131f3ef143 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -869,6 +869,8 @@ unsigned int get_next_ino(void) @@ -38133,10 +38151,10 @@ index 73432e64f874..572126ca5160 100644 /** * touch_atime - update the access time diff --git a/fs/namespace.c b/fs/namespace.c -index 678ef175d63a..8c4d3d56f2df 100644 +index 061f247a3cdb..688663b135ba 100644 --- a/fs/namespace.c +++ b/fs/namespace.c -@@ -434,6 +434,7 @@ void __mnt_drop_write(struct vfsmount *mnt) +@@ -435,6 +435,7 @@ void __mnt_drop_write(struct vfsmount *mnt) mnt_dec_writers(real_mount(mnt)); preempt_enable(); } @@ -38144,7 +38162,7 @@ index 678ef175d63a..8c4d3d56f2df 100644 /** * mnt_drop_write - give up write access to a mount -@@ -768,6 +769,13 @@ static inline int check_mnt(struct mount *mnt) +@@ -769,6 +770,13 @@ static inline int check_mnt(struct mount *mnt) return mnt->mnt_ns == current->nsproxy->mnt_ns; } @@ -38158,27 +38176,19 @@ index 678ef175d63a..8c4d3d56f2df 100644 /* * vfsmount lock must be held for write */ -@@ -1836,6 +1844,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, +@@ -1880,6 +1888,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, } return 0; } +EXPORT_SYMBOL_GPL(iterate_mounts); - static void cleanup_group_ids(struct mount *mnt, struct mount *end) + static void lock_mnt_tree(struct mount *mnt) { diff --git a/fs/notify/group.c b/fs/notify/group.c -index c03b83662876..817f22c6e191 100644 +index c03b83662876..94d210ca384a 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - #include - #include "fsnotify.h" -@@ -112,6 +113,7 @@ void fsnotify_get_group(struct fsnotify_group *group) +@@ -112,6 +112,7 @@ void fsnotify_get_group(struct fsnotify_group *group) { refcount_inc(&group->refcnt); } @@ -38186,7 +38196,7 @@ index c03b83662876..817f22c6e191 100644 /* * Drop a reference to a group. Free it if it's through. -@@ -121,6 +123,7 @@ void fsnotify_put_group(struct fsnotify_group *group) +@@ -121,6 +122,7 @@ void fsnotify_put_group(struct fsnotify_group *group) if (refcount_dec_and_test(&group->refcnt)) fsnotify_final_destroy_group(group); } @@ -38194,7 +38204,7 @@ index c03b83662876..817f22c6e191 100644 /* * Create a new fsnotify_group and hold a reference for the group returned. -@@ -150,6 +153,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) +@@ -150,6 +152,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) return group; } @@ -38203,7 +38213,7 @@ index c03b83662876..817f22c6e191 100644 int fsnotify_fasync(int fd, struct file *file, int on) { diff --git a/fs/notify/mark.c b/fs/notify/mark.c -index d2dd16cb5989..cf709b7d611a 100644 +index e9d49191d39e..21fa85b24ed6 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -289,6 +289,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark) @@ -38222,7 +38232,7 @@ index d2dd16cb5989..cf709b7d611a 100644 /* * Sorting function for lists of fsnotify marks. -@@ -658,6 +660,7 @@ int fsnotify_add_mark(struct fsnotify_mark *mark, fsnotify_connp_t *connp, +@@ -693,6 +695,7 @@ int fsnotify_add_mark(struct fsnotify_mark *mark, fsnotify_connp_t *connp, mutex_unlock(&group->mark_mutex); return ret; } @@ -38230,16 +38240,16 @@ index d2dd16cb5989..cf709b7d611a 100644 /* * Given a list of marks, find the mark associated with given group. If found -@@ -781,6 +784,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark, - fsnotify_get_group(group); +@@ -817,6 +820,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark, mark->group = group; + WRITE_ONCE(mark->connector, NULL); } +EXPORT_SYMBOL_GPL(fsnotify_init_mark); /* * Destroy all marks in destroy_list, waits for SRCU period to finish before diff --git a/fs/open.c b/fs/open.c -index f1c2f855fd43..b190d39f7813 100644 +index a00350018a47..fc17a6a34071 100644 --- a/fs/open.c +++ b/fs/open.c @@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, @@ -38251,10 +38261,10 @@ index f1c2f855fd43..b190d39f7813 100644 long vfs_truncate(const struct path *path, loff_t length) { diff --git a/fs/proc/base.c b/fs/proc/base.c -index f5ed9512d193..e8f8e59d93bb 100644 +index 0c9bef89ac43..051579cf1e49 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -2014,7 +2014,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path) +@@ -2019,7 +2019,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path) down_read(&mm->mmap_sem); vma = find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { @@ -38280,7 +38290,7 @@ index 3b63be64e436..fb9913bf3d10 100644 ino = inode->i_ino; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 85b0ef890b28..0f7fb8138160 100644 +index 95ca1fe7283c..914d9fa7c596 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -305,7 +305,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma) @@ -38295,7 +38305,7 @@ index 85b0ef890b28..0f7fb8138160 100644 dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; -@@ -1740,7 +1743,7 @@ static int show_numa_map(struct seq_file *m, void *v) +@@ -1760,7 +1763,7 @@ static int show_numa_map(struct seq_file *m, void *v) struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; @@ -38305,7 +38315,7 @@ index 85b0ef890b28..0f7fb8138160 100644 struct mm_walk walk = { .hugetlb_entry = gather_hugetlb_stats, diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c -index 0b63d68dedb2..400d1c594ceb 100644 +index 36bf0f2e102e..8df6cbc58756 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -155,7 +155,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma) @@ -38321,7 +38331,7 @@ index 0b63d68dedb2..400d1c594ceb 100644 ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; diff --git a/fs/read_write.c b/fs/read_write.c -index 27b69b85d49f..7d4dc4e44375 100644 +index 61b43ad7608e..50fb9b2d1418 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -459,6 +459,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) @@ -38332,7 +38342,7 @@ index 27b69b85d49f..7d4dc4e44375 100644 static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) { -@@ -489,6 +490,30 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count, +@@ -489,6 +490,30 @@ static ssize_t __vfs_write(struct file *file, const char __user *p, return -EINVAL; } @@ -38372,10 +38382,10 @@ index 27b69b85d49f..7d4dc4e44375 100644 static inline loff_t file_pos_read(struct file *file) { diff --git a/fs/splice.c b/fs/splice.c -index 90c29675d573..4b2d6f463662 100644 +index 25212dcca2df..f277bda5f717 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -837,8 +837,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); +@@ -833,8 +833,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); /* * Attempt to initiate a splice from pipe to file. */ @@ -38386,7 +38396,7 @@ index 90c29675d573..4b2d6f463662 100644 { ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); -@@ -850,13 +850,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, +@@ -846,13 +846,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, return splice_write(pipe, out, ppos, len, flags); } @@ -38404,7 +38414,7 @@ index 90c29675d573..4b2d6f463662 100644 { ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); -@@ -879,6 +880,7 @@ static long do_splice_to(struct file *in, loff_t *ppos, +@@ -875,6 +876,7 @@ static long do_splice_to(struct file *in, loff_t *ppos, return splice_read(in, ppos, pipe, len, flags); } @@ -38446,10 +38456,10 @@ index 0d6a6a4af861..7ce4701b7289 100644 ssize_t __vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name, diff --git a/include/linux/fs.h b/include/linux/fs.h -index fd423fec8d83..8673e424bab1 100644 +index dd28e7679089..77933034b50a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -1316,6 +1316,7 @@ extern void fasync_free(struct fasync_struct *); +@@ -1327,6 +1327,7 @@ extern void fasync_free(struct fasync_struct *); /* can be called from interrupts */ extern void kill_fasync(struct fasync_struct **, int, int); @@ -38457,7 +38467,7 @@ index fd423fec8d83..8673e424bab1 100644 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force); extern int f_setown(struct file *filp, unsigned long arg, int force); extern void f_delown(struct file *filp); -@@ -1809,6 +1810,7 @@ struct file_operations { +@@ -1806,6 +1807,7 @@ struct file_operations { ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); @@ -38465,7 +38475,7 @@ index fd423fec8d83..8673e424bab1 100644 int (*flock) (struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); -@@ -1879,6 +1881,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, +@@ -1876,6 +1878,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, struct iovec *fast_pointer, struct iovec **ret_pointer); @@ -38478,7 +38488,7 @@ index fd423fec8d83..8673e424bab1 100644 extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *); extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); -@@ -2304,6 +2312,7 @@ extern int current_umask(void); +@@ -2306,6 +2314,7 @@ extern int current_umask(void); extern void ihold(struct inode * inode); extern void iput(struct inode *); extern int generic_update_time(struct inode *, struct timespec64 *, int); @@ -38486,7 +38496,7 @@ index fd423fec8d83..8673e424bab1 100644 /* /sys/fs */ extern struct kobject *fs_kobj; -@@ -2591,6 +2600,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb) +@@ -2594,6 +2603,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb) return false; } #endif @@ -38495,10 +38505,10 @@ index fd423fec8d83..8673e424bab1 100644 extern const struct file_operations def_blk_fops; extern const struct file_operations def_chr_fops; diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h -index c5335df2372f..4e48a5059536 100644 +index 79c3873d58ac..470795d9f4a2 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h -@@ -306,6 +306,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock, +@@ -320,6 +320,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock, return lock->key == key; } @@ -38507,7 +38517,7 @@ index c5335df2372f..4e48a5059536 100644 /* * Acquire a lock. * -@@ -432,6 +434,7 @@ struct lockdep_map { }; +@@ -458,6 +460,7 @@ struct lockdep_map { }; #define lockdep_depth(tsk) (0) @@ -38516,10 +38526,10 @@ index c5335df2372f..4e48a5059536 100644 #define lockdep_assert_held(l) do { (void)(l); } while (0) diff --git a/include/linux/mm.h b/include/linux/mm.h -index 80bb6408fe73..59a1ea611ba7 100644 +index 6b10c21630f5..5951915df163 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -1518,6 +1518,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, +@@ -1486,6 +1486,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, unmap_mapping_range(mapping, holebegin, holelen, 0); } @@ -38549,10 +38559,10 @@ index 80bb6408fe73..59a1ea611ba7 100644 void *buf, int len, unsigned int gup_flags); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index 2c471a2c43fa..c6e7aa6996ff 100644 +index 4ef4bbe78a1d..8cac6e0bc1a8 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h -@@ -244,6 +244,7 @@ struct vm_region { +@@ -250,6 +250,7 @@ struct vm_region { unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ struct file *vm_file; /* the backing file or NULL */ @@ -38560,7 +38570,7 @@ index 2c471a2c43fa..c6e7aa6996ff 100644 int vm_usage; /* region usage count (access under nommu_region_sem) */ bool vm_icache_flushed : 1; /* true if the icache has been flushed for -@@ -318,6 +319,7 @@ struct vm_area_struct { +@@ -324,6 +325,7 @@ struct vm_area_struct { unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units */ struct file * vm_file; /* File we map to (can be NULL). */ @@ -38604,7 +38614,7 @@ index 74b4911ac16d..19789fbea567 100644 #endif diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h new file mode 100644 -index 000000000000..05cfb756e4e5 +index 000000000000..a19cbb220391 --- /dev/null +++ b/include/uapi/linux/aufs_type.h @@ -0,0 +1,448 @@ @@ -38650,7 +38660,7 @@ index 000000000000..05cfb756e4e5 + +#include + -+#define AUFS_VERSION "4.20.4+-20190311" ++#define AUFS_VERSION "5.1-20190610" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') @@ -39057,10 +39067,10 @@ index 000000000000..05cfb756e4e5 + +#endif /* __AUFS_TYPE_H__ */ diff --git a/kernel/fork.c b/kernel/fork.c -index b69248e6f0e0..099b89978dd3 100644 +index 2628f3773ca8..2a6daff0af21 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -547,7 +547,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, +@@ -546,7 +546,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; @@ -39070,10 +39080,10 @@ index b69248e6f0e0..099b89978dd3 100644 atomic_dec(&inode->i_writecount); i_mmap_lock_write(mapping); diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c -index e805fe3bf87f..10a2cf88add3 100644 +index e221be724fe8..92de98d9c634 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -143,7 +143,7 @@ static +@@ -151,7 +151,7 @@ static #endif struct lock_class lock_classes[MAX_LOCKDEP_KEYS]; @@ -39082,7 +39092,7 @@ index e805fe3bf87f..10a2cf88add3 100644 { if (!hlock->class_idx) { /* -@@ -154,6 +154,8 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock) +@@ -162,6 +162,8 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock) } return lock_classes + hlock->class_idx - 1; } @@ -39114,10 +39124,10 @@ index d210cc9d6f80..e77e80ce7298 100644 obj-y += init-mm.o obj-y += memblock.o diff --git a/mm/filemap.c b/mm/filemap.c -index 9f5e323e883e..90db684a7cf4 100644 +index d78f577baef2..7dcd21948a79 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -2677,7 +2677,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) +@@ -2764,7 +2764,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) vm_fault_t ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); @@ -39127,10 +39137,10 @@ index 9f5e323e883e..90db684a7cf4 100644 if (page->mapping != inode->i_mapping) { unlock_page(page); diff --git a/mm/mmap.c b/mm/mmap.c -index fc1809b1bed6..8f62e47a60ea 100644 +index 2d6a6662edb9..fb68b16fc342 100644 --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -180,7 +180,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) +@@ -181,7 +181,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -39139,7 +39149,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 mpol_put(vma_policy(vma)); vm_area_free(vma); return next; -@@ -929,7 +929,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, +@@ -930,7 +930,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, if (remove_next) { if (file) { uprobe_munmap(next, next->vm_start, next->vm_end); @@ -39148,7 +39158,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 } if (next->anon_vma) anon_vma_merge(vma, next); -@@ -1845,8 +1845,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr, +@@ -1846,8 +1846,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr, return addr; unmap_and_free_vma: @@ -39158,7 +39168,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 /* Undo any partial mapping done by a device driver. */ unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); -@@ -2675,7 +2675,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2679,7 +2679,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, goto out_free_mpol; if (new->vm_file) @@ -39167,7 +39177,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); -@@ -2694,7 +2694,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2698,7 +2698,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, if (new->vm_ops && new->vm_ops->close) new->vm_ops->close(new); if (new->vm_file) @@ -39176,7 +39186,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 unlink_anon_vmas(new); out_free_mpol: mpol_put(vma_policy(new)); -@@ -2884,7 +2884,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, +@@ -2889,7 +2889,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, struct vm_area_struct *vma; unsigned long populate = 0; unsigned long ret = -EINVAL; @@ -39185,7 +39195,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst.\n", current->comm, current->pid); -@@ -2959,10 +2959,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, +@@ -2964,10 +2964,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, } } @@ -39214,7 +39224,7 @@ index fc1809b1bed6..8f62e47a60ea 100644 out: up_write(&mm->mmap_sem); if (populate) -@@ -3252,7 +3269,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -3257,7 +3274,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) @@ -39359,47 +39369,20 @@ index 000000000000..024cdcfae1b1 + fput(pr); +} +#endif /* !CONFIG_MMU */ -diff --git a/security/commoncap.c b/security/commoncap.c -index 232db019f051..a402a5b72bf4 100644 ---- a/security/commoncap.c -+++ b/security/commoncap.c -@@ -1332,12 +1332,14 @@ int cap_mmap_addr(unsigned long addr) - } - return ret; - } -+EXPORT_SYMBOL_GPL(cap_mmap_addr); - - int cap_mmap_file(struct file *file, unsigned long reqprot, - unsigned long prot, unsigned long flags) - { - return 0; - } -+EXPORT_SYMBOL_GPL(cap_mmap_file); - - #ifdef CONFIG_SECURITY - diff --git a/security/device_cgroup.c b/security/device_cgroup.c -index cd97929fac66..424fd230866d 100644 +index dc28914fa72e..c2ddfea2b280 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -824,3 +825,4 @@ int __devcgroup_check_permission(short type, u32 major, u32 minor, +@@ -824,3 +824,4 @@ int __devcgroup_check_permission(short type, u32 major, u32 minor, return 0; } +EXPORT_SYMBOL_GPL(__devcgroup_check_permission); diff --git a/security/security.c b/security/security.c -index 55bc49027ba9..870eaa8ebedc 100644 +index 23cbb1a295a3..72b2c47ef649 100644 --- a/security/security.c +++ b/security/security.c -@@ -566,6 +566,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry) +@@ -992,6 +992,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry) return 0; return call_int_hook(path_rmdir, 0, dir, dentry); } @@ -39407,7 +39390,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_path_unlink(const struct path *dir, struct dentry *dentry) { -@@ -582,6 +583,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry, +@@ -1008,6 +1009,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry, return 0; return call_int_hook(path_symlink, 0, dir, dentry, old_name); } @@ -39415,7 +39398,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_path_link(struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry) -@@ -590,6 +592,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir, +@@ -1016,6 +1018,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir, return 0; return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry); } @@ -39423,7 +39406,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_path_rename(const struct path *old_dir, struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry, -@@ -617,6 +620,7 @@ int security_path_truncate(const struct path *path) +@@ -1043,6 +1046,7 @@ int security_path_truncate(const struct path *path) return 0; return call_int_hook(path_truncate, 0, path); } @@ -39431,7 +39414,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_path_chmod(const struct path *path, umode_t mode) { -@@ -624,6 +628,7 @@ int security_path_chmod(const struct path *path, umode_t mode) +@@ -1050,6 +1054,7 @@ int security_path_chmod(const struct path *path, umode_t mode) return 0; return call_int_hook(path_chmod, 0, path, mode); } @@ -39439,7 +39422,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) { -@@ -631,6 +636,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) +@@ -1057,6 +1062,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) return 0; return call_int_hook(path_chown, 0, path, uid, gid); } @@ -39447,15 +39430,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_path_chroot(const struct path *path) { -@@ -716,6 +722,7 @@ int security_inode_readlink(struct dentry *dentry) - return 0; - return call_int_hook(inode_readlink, 0, dentry); - } -+EXPORT_SYMBOL_GPL(security_inode_readlink); - - int security_inode_follow_link(struct dentry *dentry, struct inode *inode, - bool rcu) -@@ -731,6 +738,7 @@ int security_inode_permission(struct inode *inode, int mask) +@@ -1157,6 +1163,7 @@ int security_inode_permission(struct inode *inode, int mask) return 0; return call_int_hook(inode_permission, 0, inode, mask); } @@ -39463,7 +39438,7 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_inode_setattr(struct dentry *dentry, struct iattr *attr) { -@@ -902,6 +910,7 @@ int security_file_permission(struct file *file, int mask) +@@ -1328,6 +1335,7 @@ int security_file_permission(struct file *file, int mask) return fsnotify_perm(file, mask); } @@ -39471,11 +39446,3 @@ index 55bc49027ba9..870eaa8ebedc 100644 int security_file_alloc(struct file *file) { -@@ -961,6 +970,7 @@ int security_mmap_file(struct file *file, unsigned long prot, - return ret; - return ima_file_mmap(file, prot); - } -+EXPORT_SYMBOL_GPL(security_mmap_file); - - int security_mmap_addr(unsigned long addr) - { diff --git a/kernel.spec b/kernel.spec index 08e7e0a..eb8b9bb 100644 --- a/kernel.spec +++ b/kernel.spec @@ -178,7 +178,7 @@ Patch102: audit-make-it-less-verbose.patch Patch105: perf-silence-format-warnings-gcc8.patch # AUFS from http://aufs.sourceforge.net/ -Patch109: fs-aufs4.patch +Patch109: fs-aufs.patch # Sanitizing kernel memory # We do not use "Patch:" here because apply_patches would always apply it