lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Feb 2015 19:30:50 +0100
From:	Jiri Slaby <jslaby@...e.cz>
To:	Josh Poimboeuf <jpoimboe@...hat.com>,
	Seth Jennings <sjenning@...hat.com>,
	Jiri Kosina <jkosina@...e.cz>, Vojtech Pavlik <vojtech@...e.cz>
CC:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 4/9] livepatch: get function sizes

On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote:
> --- a/kernel/livepatch/core.c
> +++ b/kernel/livepatch/core.c
> @@ -197,8 +197,25 @@ static int klp_find_verify_func_addr(struct klp_object *obj,
>  	else
>  		ret = klp_verify_vmlinux_symbol(func->old_name,
>  						func->old_addr);
> +	if (ret)
> +		return ret;
>  
> -	return ret;
> +	ret = kallsyms_lookup_size_offset(func->old_addr, &func->old_size,
> +					  NULL);
> +	if (!ret) {
> +		pr_err("kallsyms lookup failed for '%s'\n", func->old_name);
> +		return -EINVAL;
> +	}
> +
> +	ret = kallsyms_lookup_size_offset((unsigned long)func->new_func,
> +					  &func->new_size, NULL);
> +	if (!ret) {
> +		pr_err("kallsyms lookup failed for '%s' replacement\n",
> +		       func->old_name);
> +		return -EINVAL;

EINVAL does not seem to be an appropriate return value for "not found".
Maybe ENOENT?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ