<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/netlink/genetlink.c, branch linux-4.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-04-13T17:58:22Z</updated>
<entry>
<title>netlink: pass extended ACK struct where available</title>
<updated>2017-04-13T17:58:22Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2017-04-12T12:34:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe52145f91fe81b994e4622f6b9c3a0f22643363'/>
<id>urn:sha1:fe52145f91fe81b994e4622f6b9c3a0f22643363</id>
<content type='text'>
This is an add-on to the previous patch that passes the extended ACK
structure where it's already available by existing genl_info or extack
function arguments.

This was done with this spatch (with some manual adjustment of
indentation):

@@
expression A, B, C, D, E;
identifier fn, info;
@@
fn(..., struct genl_info *info, ...) {
...
-nlmsg_parse(A, B, C, D, E, NULL)
+nlmsg_parse(A, B, C, D, E, info-&gt;extack)
...
}

@@
expression A, B, C, D, E;
identifier fn, info;
@@
fn(..., struct genl_info *info, ...) {
&lt;...
-nla_parse_nested(A, B, C, D, NULL)
+nla_parse_nested(A, B, C, D, info-&gt;extack)
...&gt;
}

@@
expression A, B, C, D, E;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
&lt;...
-nlmsg_parse(A, B, C, D, E, NULL)
+nlmsg_parse(A, B, C, D, E, extack)
...&gt;
}

@@
expression A, B, C, D, E;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
&lt;...
-nla_parse(A, B, C, D, E, NULL)
+nla_parse(A, B, C, D, E, extack)
...&gt;
}

@@
expression A, B, C, D, E;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
...
-nlmsg_parse(A, B, C, D, E, NULL)
+nlmsg_parse(A, B, C, D, E, extack)
...
}

@@
expression A, B, C, D;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
&lt;...
-nla_parse_nested(A, B, C, D, NULL)
+nla_parse_nested(A, B, C, D, extack)
...&gt;
}

@@
expression A, B, C, D;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
&lt;...
-nlmsg_validate(A, B, C, D, NULL)
+nlmsg_validate(A, B, C, D, extack)
...&gt;
}

@@
expression A, B, C, D;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
&lt;...
-nla_validate(A, B, C, D, NULL)
+nla_validate(A, B, C, D, extack)
...&gt;
}

@@
expression A, B, C;
identifier fn, extack;
@@
fn(..., struct netlink_ext_ack *extack, ...) {
&lt;...
-nla_validate_nested(A, B, C, NULL)
+nla_validate_nested(A, B, C, extack)
...&gt;
}

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: pass extended ACK struct to parsing functions</title>
<updated>2017-04-13T17:58:22Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2017-04-12T12:34:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fceb6435e85298f747fee938415057af837f5a8a'/>
<id>urn:sha1:fceb6435e85298f747fee938415057af837f5a8a</id>
<content type='text'>
Pass the new extended ACK reporting struct to all of the generic
netlink parsing functions. For now, pass NULL in almost all callers
(except for some in the core.)

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 extended ACK report down</title>
<updated>2017-04-13T17:58:21Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2017-04-12T12:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ab606d1609dd6dfeae9c8ad0a8a4e051d831e46'/>
<id>urn:sha1:7ab606d1609dd6dfeae9c8ad0a8a4e051d831e46</id>
<content type='text'>
Pass the extended ACK reporting struct down from generic netlink to
the families, using the existing struct genl_info for simplicity.

Also add support to set the extended ACK information from generic
netlink users.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: extended ACK reporting</title>
<updated>2017-04-13T17:58:20Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2017-04-12T12:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2d4bc93368f5a0ddb57c8c885cdad9c9b7a10ed5'/>
<id>urn:sha1:2d4bc93368f5a0ddb57c8c885cdad9c9b7a10ed5</id>
<content type='text'>
Add the base infrastructure and UAPI for netlink extended ACK
reporting. All "manual" calls to netlink_ack() pass NULL for now and
thus don't get extended ACK reporting.

Big thanks goes to Pablo Neira Ayuso for not only bringing up the
whole topic at netconf (again) but also coming up with the nlattr
passing trick and various other ideas.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Reviewed-by: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: fix counting regression on ctrl_dumpfamily()</title>
<updated>2017-03-22T22:38:43Z</updated>
<author>
<name>Stanislaw Gruszka</name>
</author>
<published>2017-03-22T15:08:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d2a6a5e4bf2921531071fcff8538623dce74efa'/>
<id>urn:sha1:1d2a6a5e4bf2921531071fcff8538623dce74efa</id>
<content type='text'>
Commit 2ae0f17df1cd ("genetlink: use idr to track families") replaced

	if (++n &lt; fams_to_skip)
		continue;
into:

	if (n++ &lt; fams_to_skip)
		continue;

This subtle change cause that on retry ctrl_dumpfamily() call we omit
one family that failed to do ctrl_fill_info() on previous call, because
cb-&gt;args[0] = n number counts also family that failed to do
ctrl_fill_info().

Patch fixes the problem and avoid confusion in the future just decrease
n counter when ctrl_fill_info() fail.

User visible problem caused by this bug is failure to get access to
some genetlink family i.e. nl80211. However problem is reproducible
only if number of registered genetlink families is big enough to
cause second call of ctrl_dumpfamily().

Cc: Xose Vazquez Perez &lt;xose.vazquez@gmail.com&gt;
Cc: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Fixes: 2ae0f17df1cd ("genetlink: use idr to track families")
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Acked-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2016-11-15T15:54:36Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2016-11-15T15:54:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb598c1b8c9bf56981927dcb8c0dc34b8ff95342'/>
<id>urn:sha1:bb598c1b8c9bf56981927dcb8c0dc34b8ff95342</id>
<content type='text'>
Several cases of bug fixes in 'net' overlapping other changes in
'net-next-.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: fix a memory leak on error path</title>
<updated>2016-11-03T20:52:29Z</updated>
<author>
<name>WANG Cong</name>
</author>
<published>2016-11-03T16:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00ffc1ba02d876478c125e4305f9a02d40c6d284'/>
<id>urn:sha1:00ffc1ba02d876478c125e4305f9a02d40c6d284</id>
<content type='text'>
In __genl_register_family(), when genl_validate_assign_mc_groups()
fails, we forget to free the memory we possibly allocate for
family-&gt;attrbuf.

Note, some callers call genl_unregister_family() to clean up
on error path, it doesn't work because the family is inserted
to the global list in the nearly last step.

Cc: Jakub Kicinski &lt;kubakici@wp.pl&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: fix error return code in genl_register_family()</title>
<updated>2016-11-01T16:13:13Z</updated>
<author>
<name>Wei Yongjun</name>
</author>
<published>2016-11-01T14:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22ca904ad70afc831d8503e80be1b6558a978759'/>
<id>urn:sha1:22ca904ad70afc831d8503e80be1b6558a978759</id>
<content type='text'>
Fix to return a negative error code from the idr_alloc() error handling
case instead of 0, as done elsewhere in this function.

Also fix the return value check of idr_alloc() since idr_alloc return
negative errors on failure, not zero.

Fixes: 2ae0f17df1cd ("genetlink: use idr to track families")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: Fix generic netlink family unregister</title>
<updated>2016-10-30T00:58:15Z</updated>
<author>
<name>pravin shelar</name>
</author>
<published>2016-10-28T23:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e82c7635997a11dbcfa98835c179084447ae2b0'/>
<id>urn:sha1:0e82c7635997a11dbcfa98835c179084447ae2b0</id>
<content type='text'>
This patch fixes a typo in unregister operation.

Following crash is fixed by this patch. It can be easily reproduced
by repeating modprobe and rmmod module that uses genetlink.

[  261.446686] BUG: unable to handle kernel paging request at ffffffffa0264088
[  261.448921] IP: [&lt;ffffffff813cb70e&gt;] strcmp+0xe/0x30
[  261.450494] PGD 1c09067
[  261.451266] PUD 1c0a063
[  261.452091] PMD 8068d5067
[  261.452525] PTE 0
[  261.453164]
[  261.453618] Oops: 0000 [#1] SMP
[  261.454577] Modules linked in: openvswitch(+) ...
[  261.480753] RIP: 0010:[&lt;ffffffff813cb70e&gt;]  [&lt;ffffffff813cb70e&gt;] strcmp+0xe/0x30
[  261.483069] RSP: 0018:ffffc90003c0bc28  EFLAGS: 00010282
[  261.510145] Call Trace:
[  261.510896]  [&lt;ffffffff816f10ca&gt;] genl_family_find_byname+0x5a/0x70
[  261.512819]  [&lt;ffffffff816f2319&gt;] genl_register_family+0xb9/0x630
[  261.514805]  [&lt;ffffffffa02840bc&gt;] dp_init+0xbc/0x120 [openvswitch]
[  261.518268]  [&lt;ffffffff8100217d&gt;] do_one_initcall+0x3d/0x160
[  261.525041]  [&lt;ffffffff811808a9&gt;] do_init_module+0x60/0x1f1
[  261.526754]  [&lt;ffffffff8110687f&gt;] load_module+0x22af/0x2860
[  261.530144]  [&lt;ffffffff81107026&gt;] SYSC_finit_module+0x96/0xd0
[  261.531901]  [&lt;ffffffff8110707e&gt;] SyS_finit_module+0xe/0x10
[  261.533605]  [&lt;ffffffff8100391e&gt;] do_syscall_64+0x6e/0x180
[  261.535284]  [&lt;ffffffff817c2faf&gt;] entry_SYSCALL64_slow_path+0x25/0x25
[  261.546512] RIP  [&lt;ffffffff813cb70e&gt;] strcmp+0xe/0x30
[  261.550198] ---[ end trace 76505a814dd68770 ]---

Fixes: 2ae0f17df1c ("genetlink: use idr to track families").

Reported-by: Jarno Rajahalme &lt;jarno@ovn.org&gt;
CC: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Reviewed-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>genetlink: mark families as __ro_after_init</title>
<updated>2016-10-27T20:16:09Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2016-10-24T12:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56989f6d8568c21257dcec0f5e644d5570ba3281'/>
<id>urn:sha1:56989f6d8568c21257dcec0f5e644d5570ba3281</id>
<content type='text'>
Now genl_register_family() is the only thing (other than the
users themselves, perhaps, but I didn't find any doing that)
writing to the family struct.

In all families that I found, genl_register_family() is only
called from __init functions (some indirectly, in which case
I've add __init annotations to clarifly things), so all can
actually be marked __ro_after_init.

This protects the data structure from accidental corruption.

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>
