1 |
commit: e068fdfc2b6f09d2629d079ab7ad91d710573778 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 28 22:32:32 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 21 15:01:24 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e068fdfc |
7 |
|
8 |
Linux patch 4.4.153 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 ++ |
13 |
1152_linux-4.4.153.patch | 134 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 138 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index ebf1b99..e62afd1 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -651,6 +651,10 @@ Patch: 1151_linux-4.4.152.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.152 |
23 |
|
24 |
+Patch: 1152_linux-4.4.153.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.153 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1152_linux-4.4.153.patch b/1152_linux-4.4.153.patch |
33 |
new file mode 100644 |
34 |
index 0000000..bcec2ae |
35 |
--- /dev/null |
36 |
+++ b/1152_linux-4.4.153.patch |
37 |
@@ -0,0 +1,134 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 523b0d4354fb..208a813be615 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 4 |
45 |
+-SUBLEVEL = 152 |
46 |
++SUBLEVEL = 153 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Blurry Fish Butt |
49 |
+ |
50 |
+diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h |
51 |
+index effc12767cbf..d8d19fe99e45 100644 |
52 |
+--- a/arch/x86/include/asm/mmu_context.h |
53 |
++++ b/arch/x86/include/asm/mmu_context.h |
54 |
+@@ -109,8 +109,7 @@ static inline int init_new_context(struct task_struct *tsk, |
55 |
+ struct mm_struct *mm) |
56 |
+ { |
57 |
+ mm->context.ctx_id = atomic64_inc_return(&last_mm_ctx_id); |
58 |
+- init_new_context_ldt(tsk, mm); |
59 |
+- return 0; |
60 |
++ return init_new_context_ldt(tsk, mm); |
61 |
+ } |
62 |
+ static inline void destroy_context(struct mm_struct *mm) |
63 |
+ { |
64 |
+diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c |
65 |
+index 27610c2d1821..1007fa80f5a6 100644 |
66 |
+--- a/arch/x86/mm/pageattr.c |
67 |
++++ b/arch/x86/mm/pageattr.c |
68 |
+@@ -1006,7 +1006,7 @@ static int populate_pmd(struct cpa_data *cpa, |
69 |
+ |
70 |
+ pmd = pmd_offset(pud, start); |
71 |
+ |
72 |
+- set_pmd(pmd, pmd_mkhuge(pfn_pmd(cpa->pfn, |
73 |
++ set_pmd(pmd, pmd_mkhuge(pfn_pmd(cpa->pfn >> PAGE_SHIFT, |
74 |
+ canon_pgprot(pmd_pgprot)))); |
75 |
+ |
76 |
+ start += PMD_SIZE; |
77 |
+diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h |
78 |
+index c319d5eaabcf..28316b292b8a 100644 |
79 |
+--- a/fs/overlayfs/overlayfs.h |
80 |
++++ b/fs/overlayfs/overlayfs.h |
81 |
+@@ -163,6 +163,7 @@ extern const struct file_operations ovl_dir_operations; |
82 |
+ int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list); |
83 |
+ void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list); |
84 |
+ void ovl_cache_free(struct list_head *list); |
85 |
++int ovl_check_d_type_supported(struct path *realpath); |
86 |
+ |
87 |
+ /* inode.c */ |
88 |
+ int ovl_setattr(struct dentry *dentry, struct iattr *attr); |
89 |
+diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c |
90 |
+index 299a6e1d6b77..0c59955c4653 100644 |
91 |
+--- a/fs/overlayfs/readdir.c |
92 |
++++ b/fs/overlayfs/readdir.c |
93 |
+@@ -43,6 +43,7 @@ struct ovl_readdir_data { |
94 |
+ struct ovl_cache_entry *first_maybe_whiteout; |
95 |
+ int count; |
96 |
+ int err; |
97 |
++ bool d_type_supported; |
98 |
+ }; |
99 |
+ |
100 |
+ struct ovl_dir_file { |
101 |
+@@ -581,3 +582,39 @@ void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list) |
102 |
+ } |
103 |
+ mutex_unlock(&upper->d_inode->i_mutex); |
104 |
+ } |
105 |
++ |
106 |
++static int ovl_check_d_type(struct dir_context *ctx, const char *name, |
107 |
++ int namelen, loff_t offset, u64 ino, |
108 |
++ unsigned int d_type) |
109 |
++{ |
110 |
++ struct ovl_readdir_data *rdd = |
111 |
++ container_of(ctx, struct ovl_readdir_data, ctx); |
112 |
++ |
113 |
++ /* Even if d_type is not supported, DT_DIR is returned for . and .. */ |
114 |
++ if (!strncmp(name, ".", namelen) || !strncmp(name, "..", namelen)) |
115 |
++ return 0; |
116 |
++ |
117 |
++ if (d_type != DT_UNKNOWN) |
118 |
++ rdd->d_type_supported = true; |
119 |
++ |
120 |
++ return 0; |
121 |
++} |
122 |
++ |
123 |
++/* |
124 |
++ * Returns 1 if d_type is supported, 0 not supported/unknown. Negative values |
125 |
++ * if error is encountered. |
126 |
++ */ |
127 |
++int ovl_check_d_type_supported(struct path *realpath) |
128 |
++{ |
129 |
++ int err; |
130 |
++ struct ovl_readdir_data rdd = { |
131 |
++ .ctx.actor = ovl_check_d_type, |
132 |
++ .d_type_supported = false, |
133 |
++ }; |
134 |
++ |
135 |
++ err = ovl_dir_read(realpath, &rdd); |
136 |
++ if (err) |
137 |
++ return err; |
138 |
++ |
139 |
++ return rdd.d_type_supported; |
140 |
++} |
141 |
+diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c |
142 |
+index d70208c0de84..0035cb80ecd1 100644 |
143 |
+--- a/fs/overlayfs/super.c |
144 |
++++ b/fs/overlayfs/super.c |
145 |
+@@ -1054,6 +1054,26 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) |
146 |
+ sb->s_flags |= MS_RDONLY; |
147 |
+ ufs->workdir = NULL; |
148 |
+ } |
149 |
++ |
150 |
++ /* |
151 |
++ * Upper should support d_type, else whiteouts are visible. |
152 |
++ * Given workdir and upper are on same fs, we can do |
153 |
++ * iterate_dir() on workdir. This check requires successful |
154 |
++ * creation of workdir in previous step. |
155 |
++ */ |
156 |
++ if (ufs->workdir) { |
157 |
++ err = ovl_check_d_type_supported(&workpath); |
158 |
++ if (err < 0) |
159 |
++ goto out_put_workdir; |
160 |
++ |
161 |
++ /* |
162 |
++ * We allowed this configuration and don't want to |
163 |
++ * break users over kernel upgrade. So warn instead |
164 |
++ * of erroring out. |
165 |
++ */ |
166 |
++ if (!err) |
167 |
++ pr_warn("overlayfs: upper fs needs to support d_type.\n"); |
168 |
++ } |
169 |
+ } |
170 |
+ |
171 |
+ err = -ENOMEM; |