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