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]
Message-ID: <alpine.LNX.2.00.1505192357320.8186@pobox.suse.cz>
Date:	Tue, 19 May 2015 23:58:05 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Minfei Huang <mnfhuang@...il.com>
cc:	Jiri Slaby <jslaby@...e.cz>, live-patching@...r.kernel.org,
	jpoimboe@...hat.com, sjenning@...hat.com, vojtech@...e.cz,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] livepatch: introduce patch/func-walking helpers

On Tue, 19 May 2015, Minfei Huang wrote:

> > klp_for_each_object and klp_for_each_func are now used all over the
> > code. One need not think what is the proper condition to check in the
> > for loop now.
> > 
> > Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> > ---
> >  include/linux/livepatch.h |  6 ++++++
> >  kernel/livepatch/core.c   | 18 +++++++++---------
> >  2 files changed, 15 insertions(+), 9 deletions(-)
> > 
> > diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h
> > index fe45f2f02c8d..31db7a05dd36 100644
> > --- a/include/linux/livepatch.h
> > +++ b/include/linux/livepatch.h
> > @@ -805,7 +805,7 @@ static int klp_init_patch(struct klp_patch *patch)
> >  	if (ret)
> >  		goto unlock;
> >  
> > -	for (obj = patch->objs; obj->funcs; obj++) {
> > +	klp_for_each_object(patch, obj) {
> >  		ret = klp_init_object(patch, obj);
> >  		if (ret)
> >  			goto free;
> > @@ -960,7 +960,7 @@ static int klp_module_notify(struct notifier_block *nb, unsigned long action,
> >  		mod->klp_alive = false;
> >  
> >  	list_for_each_entry(patch, &klp_patches, list) {
> > -		for (obj = patch->objs; obj->funcs; obj++) {
> > +		klp_for_each_object(patch, obj) {
> 
> The code is more clearly to use "if", instead of the loop, although we will take
> more than one line than previous, since we will always get the first function
> from the object.

I have absolutely no idea what you are trying to say here, sorry. Could 
you please try to rephrase your review comment?

Thanks,

-- 
Jiri Kosina
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