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:	Fri, 15 Nov 2013 14:18:35 +0100
From:	Johannes Berg <johannes@...solutions.net>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, linux-wimax@...el.com,
	bsingharora@...il.com, netfilter-devel@...r.kernel.org,
	alex.bluesman.smirnov@...il.com, dbaryshkov@...il.com
Subject: Re: [PATCH 0/9] genetlink: reduce ops size and complexity (v2)

On Thu, 2013-11-14 at 17:12 -0500, David Miller wrote:
> From: Johannes Berg <johannes@...solutions.net>
> Date: Thu, 14 Nov 2013 17:14:38 +0100
> 
> > As before - reduce the complexity and data/code size of genetlink ops
> > by making them an array rather than a linked list. Most users already
> > use an array thanks to genl_register_family_with_ops(), so convert the
> > remaining ones allowing us to get rid of the list head in each op.
> > 
> > Also make them const, this just makes sense at that point and the security
> > people like making function pointers const as well :-)
> 
> I have to say, this is an absolutely fantastic space usage and
> complexity improvement.

:-)

FWIW, we can also clean up the two registration functions now and make
it just a single one (actually we could have done that before as well,
passing NULL for ops, but hey, now it's even easier). I'll send a patch
for that.

I've been eyeing the multicast groups as well, but the code using them
is nicer if it's not an array. With an array, you'd have to do something
like

send_event(&my_mcast_groups[1]);

instead of

send_event(&my_foo_mcast_group);

which is a bit odd.

We could instead register an array of pointers to the groups:

static const struct mcast_group *my_groups[] = {
	&my_foo_mcast_group,
	...
};

and pass this to the family - that'd still be less space (one pointer
for each group rather than two in a linked list) and still allow all
groups and this array to be const, but it's not quite as big a
saving ...

Thoughts?

johannes


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists