Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292895 > unrolled thread

Re: [RFC PATCH v2 2/6] module: preserve Elf information for livepatch modules

Started byMiroslav Benes <mbenes@suse.cz>
First post2015-12-16 12:00 +0100
Last post2015-12-17 02:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC PATCH v2 2/6] module: preserve Elf information for livepatch  modules Miroslav Benes <mbenes@suse.cz> - 2015-12-16 12:00 +0100
    Re: module: preserve Elf information for livepatch modules Jessica Yu <jeyu@redhat.com> - 2015-12-17 02:10 +0100

#1292895 — Re: [RFC PATCH v2 2/6] module: preserve Elf information for livepatch modules

FromMiroslav Benes <mbenes@suse.cz>
Date2015-12-16 12:00 +0100
SubjectRe: [RFC PATCH v2 2/6] module: preserve Elf information for livepatch modules
Message-ID<qGhYl-Gy-19@gated-at.bofh.it>
On Mon, 30 Nov 2015, Jessica Yu wrote:

> @@ -3530,6 +3614,16 @@ static int load_module(struct load_info *info, const char __user *uargs,
>  	if (err < 0)
>  		goto bug_cleanup;
>  
> +	/*
> +	 * Save sechdrs, indices, and other data from info
> +	 * in order to patch to-be-loaded modules.
> +	 * Do not call free_copy() for livepatch modules.
> +	 */
> +	if (mod->klp)
> +		err = copy_module_elf(mod, info);
> +	if (err < 0)
> +		goto bug_cleanup;
> +

I think goto bug_cleanup is not sufficient. Just before this hunk sysfs is 
created. So in case of error here we should call mod_sysfs_teardown() or 
something before going to bug_cleanup. That is new error label is needed 
before bug_cleanup. Correct?

Miroslav
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1293514 — Re: module: preserve Elf information for livepatch modules

FromJessica Yu <jeyu@redhat.com>
Date2015-12-17 02:10 +0100
SubjectRe: module: preserve Elf information for livepatch modules
Message-ID<qGveX-WJ-27@gated-at.bofh.it>
In reply to#1292895
+++ Miroslav Benes [16/12/15 11:58 +0100]:
>On Mon, 30 Nov 2015, Jessica Yu wrote:
>
>> @@ -3530,6 +3614,16 @@ static int load_module(struct load_info *info, const char __user *uargs,
>>  	if (err < 0)
>>  		goto bug_cleanup;
>>
>> +	/*
>> +	 * Save sechdrs, indices, and other data from info
>> +	 * in order to patch to-be-loaded modules.
>> +	 * Do not call free_copy() for livepatch modules.
>> +	 */
>> +	if (mod->klp)
>> +		err = copy_module_elf(mod, info);
>> +	if (err < 0)
>> +		goto bug_cleanup;
>> +
>
>I think goto bug_cleanup is not sufficient. Just before this hunk sysfs is
>created. So in case of error here we should call mod_sysfs_teardown() or
>something before going to bug_cleanup. That is new error label is needed
>before bug_cleanup. Correct?

Yes I think you're right. So before bug_cleanup, we'll just need a new
label (maybe called sysfs_cleanup) that calls mod_sysfs_teardown(). In
addition, the if (err < 0) check should have been enclosed in the if
(mod->klp) block.

Jessica
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web