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, 17 Feb 2015 10:01:47 -0600
From:	Josh Poimboeuf <jpoimboe@...hat.com>
To:	Miroslav Benes <mbenes@...e.cz>
Cc:	Seth Jennings <sjenning@...hat.com>, Jiri Kosina <jkosina@...e.cz>,
	Vojtech Pavlik <vojtech@...e.cz>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 6/9] livepatch: create per-task consistency model

On Tue, Feb 17, 2015 at 04:48:39PM +0100, Miroslav Benes wrote:
> On Tue, 17 Feb 2015, Josh Poimboeuf wrote:
> 
> > On Mon, Feb 16, 2015 at 03:19:10PM +0100, Miroslav Benes wrote:
> > > On Mon, 9 Feb 2015, Josh Poimboeuf wrote:
> > > 
> 
> [...]
> 
> > > > +
> > > > +void klp_unpatch_objects(struct klp_patch *patch)
> > > > +{
> > > > +	struct klp_object *obj;
> > > > +
> > > > +	for (obj = patch->objs; obj->funcs; obj++)
> > > > +		if (obj->patched)
> > > > +			klp_unpatch_object(obj);
> > > > +}
> > > 
> > > Maybe we should introduce for_each_* macros which could be used in the 
> > > code and avoid such functions. I do not have strong opinion about it.
> > 
> > Yeah, but each such loop seems to differ a little bit, so I'm not quite
> > sure how to structure the macros such that they'd be useful.  Maybe for
> > a future patch.
> 
> Yes, that is correct. The code in the caller of klp_unpatch_objects would 
> look something like this
> 
> klp_for_each_object(obj, patch->objs)
> 	if (obj->patched)
> 		klp_unpatch_object(obj)

Yeah, that is slightly more readable and less error prone.  I'll do it.

> > > and externs for functions are redundant.
> > 
> > I agree, but it seems to be the norm in Linux.  I have no idea why.  I'm
> > just following the existing convention.
> 
> Yes, I know. It seems that each author does it differently. You can find 
> both forms even in one header file in the kernel. There is no functional 
> difference AFAIK (it is not the case for variables of course). So as long 
> as we are consistent I do not care. And since we have externs already in 
> livepatch.h... you can scratch this remark if you want to :)

Ok.  If there are no objections, let's stick with our existing
nonsensical convention for now :-)

-- 
Josh
--
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