mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	do_change_type(): refuse to operate on unmounted/not ours mounts
Ensure that propagation settings can only be changed for mounts located
in the caller's mount namespace. This change aligns permission checking
with the rest of mount(2).
Reviewed-by: Christian Brauner <brauner@kernel.org>
Fixes: 07b20889e3 ("beginning of the shared-subtree proper")
Reported-by: "Orlando, Noah" <Noah.Orlando@deshaw.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
			
			
This commit is contained in:
		
							parent
							
								
									c28f922c9d
								
							
						
					
					
						commit
						12f147ddd6
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -2959,6 +2959,10 @@ static int do_change_type(struct path *path, int ms_flags)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	namespace_lock();
 | 
						namespace_lock();
 | 
				
			||||||
 | 
						if (!check_mnt(mnt)) {
 | 
				
			||||||
 | 
							err = -EINVAL;
 | 
				
			||||||
 | 
							goto out_unlock;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if (type == MS_SHARED) {
 | 
						if (type == MS_SHARED) {
 | 
				
			||||||
		err = invent_group_ids(mnt, recurse);
 | 
							err = invent_group_ids(mnt, recurse);
 | 
				
			||||||
		if (err)
 | 
							if (err)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue