<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netlink, branch v3.13</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/netlink?h=v3.13</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/netlink?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-11-28T23:26:30Z</updated>
<entry>
<title>genetlink/pmcraid: use proper genetlink multicast API</title>
<updated>2013-11-28T23:26:30Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-24T20:09:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5e53e689b737526308db2b5c9f56e9d0371a1676'/>
<id>urn:sha1:5e53e689b737526308db2b5c9f56e9d0371a1676</id>
<content type='text'>
The pmcraid driver is abusing the genetlink API and is using its
family ID as the multicast group ID, which is invalid and may
belong to somebody else (and likely will.)

Make it use the correct API, but since this may already be used
as-is by userspace, reserve a family ID for this code and also
reserve that group ID to not break userspace assumptions.

My previous patch broke event delivery in the driver as I missed
that it wasn't using the right API and forgot to update it later
in my series.

While changing this, I noticed that the genetlink code could use
the static group ID instead of a strcmp(), so also do that for
the VFS_DQUOT family.

Cc: Anil Ravindranath &lt;anil_ravindranath@pmc-sierra.com&gt;
Cc: "James E.J. Bottomley" &lt;JBottomley@parallels.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: Fix uninitialized variable in genl_validate_assign_mc_groups()</title>
<updated>2013-11-28T23:24:07Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2013-11-23T12:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0f0e2159c0c101426b705d70f43b9f423d51c869'/>
<id>urn:sha1:0f0e2159c0c101426b705d70f43b9f423d51c869</id>
<content type='text'>
net/netlink/genetlink.c: In function ‘genl_validate_assign_mc_groups’:
net/netlink/genetlink.c:217: warning: ‘err’ may be used uninitialized in this
function

Commit 2a94fe48f32ccf7321450a2cc07f2b724a444e5b ("genetlink: make multicast
groups const, prevent abuse") split genl_register_mc_group() in multiple
functions, but dropped the initialization of err.

Initialize err to zero to fix this.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: fix genlmsg_multicast() bug</title>
<updated>2013-11-21T18:09:43Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-21T17:17:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=220815a9665f7deca98a09ecca655044f94cfa44'/>
<id>urn:sha1:220815a9665f7deca98a09ecca655044f94cfa44</id>
<content type='text'>
Unfortunately, I introduced a tremendously stupid bug into
genlmsg_multicast() when doing all those multicast group
changes: it adjusts the group number, but then passes it
to genlmsg_multicast_netns() which does that again.

Somehow, my tests failed to catch this, so add a warning
into genlmsg_multicast_netns() and remove the offending
group ID adjustment.

Also add a warning to the similar code in other functions
so people who misuse them are more loudly warned.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: rework recvmsg handler msg_name and msg_namelen logic</title>
<updated>2013-11-21T02:52:30Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2013-11-21T02:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f3d3342602f8bcbf37d7c46641cb9bca7618eb1c'/>
<id>urn:sha1:f3d3342602f8bcbf37d7c46641cb9bca7618eb1c</id>
<content type='text'>
This patch now always passes msg-&gt;msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size &lt;= sizeof(struct sockaddr_storage)
to return msg_name to the user.

This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers and makes it harder for new code to accidentally leak
uninitialized memory.

Optimize for the case recvfrom is called with NULL as address. We don't
need to copy the address at all, so set it to NULL before invoking the
recvmsg handler. We can do so, because all the recvmsg handlers must
cope with the case a plain read() is called on them. read() also sets
msg_name to NULL.

Also document these changes in include/linux/net.h as suggested by David
Miller.

Changes since RFC:

Set msg-&gt;msg_name = NULL if user specified a NULL in msg_name but had a
non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
affect sendto as it would bail out earlier while trying to copy-in the
address. It also more naturally reflects the logic by the callers of
verify_iovec.

With this change in place I could remove "
if (!uaddr || msg_sys-&gt;msg_namelen == 0)
	msg-&gt;msg_name = NULL
".

This change does not alter the user visible error logic as we ignore
msg_namelen as long as msg_name is NULL.

Also remove two unnecessary curly brackets in ___sys_recvmsg and change
comments to netdev style.

Cc: David Miller &lt;davem@davemloft.net&gt;
Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: make multicast groups const, prevent abuse</title>
<updated>2013-11-19T21:39:06Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-19T14:19:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a94fe48f32ccf7321450a2cc07f2b724a444e5b'/>
<id>urn:sha1:2a94fe48f32ccf7321450a2cc07f2b724a444e5b</id>
<content type='text'>
Register generic netlink multicast groups as an array with
the family and give them contiguous group IDs. Then instead
of passing the global group ID to the various functions that
send messages, pass the ID relative to the family - for most
families that's just 0 because the only have one group.

This avoids the list_head and ID in each group, adding a new
field for the mcast group ID offset to the family.

At the same time, this allows us to prevent abusing groups
again like the quota and dropmon code did, since we can now
check that a family only uses a group it owns.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: pass family to functions using groups</title>
<updated>2013-11-19T21:39:06Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-19T14:19:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=68eb55031da7c967d954e5f9415cd05f4abdb692'/>
<id>urn:sha1:68eb55031da7c967d954e5f9415cd05f4abdb692</id>
<content type='text'>
This doesn't really change anything, but prepares for the
next patch that will change the APIs to pass the group ID
within the family, rather than the global group ID.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: remove family pointer from genl_multicast_group</title>
<updated>2013-11-19T21:39:06Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-19T14:19:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c2ebb908469d507ff400dad94efc755e6c799672'/>
<id>urn:sha1:c2ebb908469d507ff400dad94efc755e6c799672</id>
<content type='text'>
There's no reason to have the family pointer there since it
can just be passed internally where needed, so remove it.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: remove genl_unregister_mc_group()</title>
<updated>2013-11-19T21:39:06Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-19T14:19:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=06fb555a273dc8ef0d876f4e864ad11cfcea63e0'/>
<id>urn:sha1:06fb555a273dc8ef0d876f4e864ad11cfcea63e0</id>
<content type='text'>
There are no users of this API remaining, and we'll soon
change group registration to be static (like ops are now)

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>quota/genetlink: use proper genetlink multicast APIs</title>
<updated>2013-11-19T21:39:05Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-19T14:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2ecf7536b2787580616d23b6507005d930975ca0'/>
<id>urn:sha1:2ecf7536b2787580616d23b6507005d930975ca0</id>
<content type='text'>
The quota code is abusing the genetlink API and is using
its family ID as the multicast group ID, which is invalid
and may belong to somebody else (and likely will.)

Make the quota code use the correct API, but since this
is already used as-is by userspace, reserve a family ID
for this code and also reserve that group ID to not break
userspace assumptions.

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>drop_monitor/genetlink: use proper genetlink multicast APIs</title>
<updated>2013-11-19T21:39:05Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2013-11-19T14:19:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e5dcecba015f9774a402ba559b80b16999747e3b'/>
<id>urn:sha1:e5dcecba015f9774a402ba559b80b16999747e3b</id>
<content type='text'>
The drop monitor code is abusing the genetlink API and is
statically using the generic netlink multicast group 1, even
if that group belongs to somebody else (which it invariably
will, since it's not reserved.)

Make the drop monitor code use the proper APIs to reserve a
group ID, but also reserve the group id 1 in generic netlink
code to preserve the userspace API. Since drop monitor can
be a module, don't clear the bit for it on unregistration.

Acked-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
