Re: [PATCH v3 02/10] livepatch: Apply vmlinux-specific KLP relocations early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -738,18 +765,23 @@ static int klp_init_object_loaded(struct klp_patch *patch,
>  	int ret;
>  
>  	mutex_lock(&text_mutex);
> -
>  	module_disable_ro(patch->mod);
> -	ret = klp_write_object_relocations(patch->mod, obj);
> -	if (ret) {
> -		module_enable_ro(patch->mod, true);
> -		mutex_unlock(&text_mutex);
> -		return ret;
> +
> +	if (klp_is_module(obj)) {
> +		/*
> +		 * Only write module-specific relocations here
> +		 * (.klp.rela.{module}.*).  vmlinux-specific relocations were
> +		 * written earlier during the initialization of the klp module
> +		 * itself.
> +		 */
> +		ret = klp_apply_object_relocs(patch, obj);
> +		if (ret)

+                       module_enable_ro(patch->mod, true);
+                       mutex_unlock(&text_mutex);

is missing here, I think. Probably lost during rebase. It is fine after 
the next patch.

> +			return ret;
>  	}
>  
>  	arch_klp_init_object_loaded(patch, obj);
> -	module_enable_ro(patch->mod, true);
>  
> +	module_enable_ro(patch->mod, true);
>  	mutex_unlock(&text_mutex);

Miroslav



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux