mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 08:38:45 +02:00 
			
		
		
		
	livepatch: Disallow vmlinux.ko
This is purely a theoretical issue, but if there were a module named vmlinux.ko, the livepatch relocation code wouldn't be able to distinguish between vmlinux-specific and vmlinux.o-specific KLP relocations. If CONFIG_LIVEPATCH is enabled, don't allow a module named vmlinux.ko. Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Joe Lawrence <joe.lawrence@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
		
							parent
							
								
									a811c1fa0a
								
							
						
					
					
						commit
						dcf550e52f
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -1139,6 +1139,11 @@ int klp_module_coming(struct module *mod) | |||
| 	if (WARN_ON(mod->state != MODULE_STATE_COMING)) | ||||
| 		return -EINVAL; | ||||
| 
 | ||||
| 	if (!strcmp(mod->name, "vmlinux")) { | ||||
| 		pr_err("vmlinux.ko: invalid module name"); | ||||
| 		return -EINVAL; | ||||
| 	} | ||||
| 
 | ||||
| 	mutex_lock(&klp_mutex); | ||||
| 	/*
 | ||||
| 	 * Each module has to know that klp_module_coming() | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Josh Poimboeuf
						Josh Poimboeuf