aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-12-17 09:27:08 -0500
committerIngo Molnar <mingo@kernel.org>2013-12-17 09:27:08 -0500
commitbb799d3b980eb803ca2da4a4eefbd9308f8d988a (patch)
tree69fbe0cd6d47b23a50f5e1d87bf7489532fae149 /fs/proc
parent919fc6e34831d1c2b58bfb5ae261dc3facc9b269 (diff)
parent319e2e3f63c348a9b66db4667efa73178e18b17d (diff)
Merge tag 'v3.13-rc4' into core/locking
Merge Linux 3.13-rc4, to refresh this rather old tree with the latest fixes. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c14
-rw-r--r--fs/proc/generic.c18
-rw-r--r--fs/proc/inode.c14
-rw-r--r--fs/proc/namespaces.c8
4 files changed, 21 insertions, 33 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 1485e38daaa3..03c8d747be48 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1151,10 +1151,16 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
1151 goto out_free_page; 1151 goto out_free_page;
1152 1152
1153 } 1153 }
1154 kloginuid = make_kuid(file->f_cred->user_ns, loginuid); 1154
1155 if (!uid_valid(kloginuid)) { 1155 /* is userspace tring to explicitly UNSET the loginuid? */
1156 length = -EINVAL; 1156 if (loginuid == AUDIT_UID_UNSET) {
1157 goto out_free_page; 1157 kloginuid = INVALID_UID;
1158 } else {
1159 kloginuid = make_kuid(file->f_cred->user_ns, loginuid);
1160 if (!uid_valid(kloginuid)) {
1161 length = -EINVAL;
1162 goto out_free_page;
1163 }
1158 } 1164 }
1159 1165
1160 length = audit_set_loginuid(kloginuid); 1166 length = audit_set_loginuid(kloginuid);
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 737e15615b04..cca93b6fb9a9 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -175,22 +175,6 @@ static const struct inode_operations proc_link_inode_operations = {
175}; 175};
176 176
177/* 177/*
178 * As some entries in /proc are volatile, we want to
179 * get rid of unused dentries. This could be made
180 * smarter: we could keep a "volatile" flag in the
181 * inode to indicate which ones to keep.
182 */
183static int proc_delete_dentry(const struct dentry * dentry)
184{
185 return 1;
186}
187
188static const struct dentry_operations proc_dentry_operations =
189{
190 .d_delete = proc_delete_dentry,
191};
192
193/*
194 * Don't create negative dentries here, return -ENOENT by hand 178 * Don't create negative dentries here, return -ENOENT by hand
195 * instead. 179 * instead.
196 */ 180 */
@@ -209,7 +193,7 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
209 inode = proc_get_inode(dir->i_sb, de); 193 inode = proc_get_inode(dir->i_sb, de);
210 if (!inode) 194 if (!inode)
211 return ERR_PTR(-ENOMEM); 195 return ERR_PTR(-ENOMEM);
212 d_set_d_op(dentry, &proc_dentry_operations); 196 d_set_d_op(dentry, &simple_dentry_operations);
213 d_add(dentry, inode); 197 d_add(dentry, inode);
214 return NULL; 198 return NULL;
215 } 199 }
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 28955d4b7218..124fc43c7090 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -292,16 +292,20 @@ proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr,
292{ 292{
293 struct proc_dir_entry *pde = PDE(file_inode(file)); 293 struct proc_dir_entry *pde = PDE(file_inode(file));
294 unsigned long rv = -EIO; 294 unsigned long rv = -EIO;
295 unsigned long (*get_area)(struct file *, unsigned long, unsigned long, 295
296 unsigned long, unsigned long) = NULL;
297 if (use_pde(pde)) { 296 if (use_pde(pde)) {
297 typeof(proc_reg_get_unmapped_area) *get_area;
298
299 get_area = pde->proc_fops->get_unmapped_area;
298#ifdef CONFIG_MMU 300#ifdef CONFIG_MMU
299 get_area = current->mm->get_unmapped_area; 301 if (!get_area)
302 get_area = current->mm->get_unmapped_area;
300#endif 303#endif
301 if (pde->proc_fops->get_unmapped_area) 304
302 get_area = pde->proc_fops->get_unmapped_area;
303 if (get_area) 305 if (get_area)
304 rv = get_area(file, orig_addr, len, pgoff, flags); 306 rv = get_area(file, orig_addr, len, pgoff, flags);
307 else
308 rv = orig_addr;
305 unuse_pde(pde); 309 unuse_pde(pde);
306 } 310 }
307 return rv; 311 return rv;
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
index 49a7fff2e83a..9ae46b87470d 100644
--- a/fs/proc/namespaces.c
+++ b/fs/proc/namespaces.c
@@ -42,12 +42,6 @@ static const struct inode_operations ns_inode_operations = {
42 .setattr = proc_setattr, 42 .setattr = proc_setattr,
43}; 43};
44 44
45static int ns_delete_dentry(const struct dentry *dentry)
46{
47 /* Don't cache namespace inodes when not in use */
48 return 1;
49}
50
51static char *ns_dname(struct dentry *dentry, char *buffer, int buflen) 45static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)
52{ 46{
53 struct inode *inode = dentry->d_inode; 47 struct inode *inode = dentry->d_inode;
@@ -59,7 +53,7 @@ static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)
59 53
60const struct dentry_operations ns_dentry_operations = 54const struct dentry_operations ns_dentry_operations =
61{ 55{
62 .d_delete = ns_delete_dentry, 56 .d_delete = always_delete_dentry,
63 .d_dname = ns_dname, 57 .d_dname = ns_dname,
64}; 58};
65 59