<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/net/hsr, branch v4.13</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>net/hsr: Check skb_put_padto() return value</title>
<updated>2017-08-22T20:40:23+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2017-08-21T19:59:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=414e7d76af6d3ec2dd4e9079927dbe0e2e4ca914'/>
<id>414e7d76af6d3ec2dd4e9079927dbe0e2e4ca914</id>
<content type='text'>
skb_put_padto() will free the sk_buff passed as reference in case of
errors, but we still need to check its return value and decide what to
do.

Detected by CoverityScan, CID#1416688 ("CHECKED_RETURN")

Fixes: ee1c27977284 ("net/hsr: Added support for HSR v1")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
skb_put_padto() will free the sk_buff passed as reference in case of
errors, but we still need to check its return value and decide what to
do.

Detected by CoverityScan, CID#1416688 ("CHECKED_RETURN")

Fixes: ee1c27977284 ("net/hsr: Added support for HSR v1")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: add netlink_ext_ack argument to rtnl_link_ops.newlink</title>
<updated>2017-06-27T03:13:21+00:00</updated>
<author>
<name>Matthias Schiffer</name>
<email>mschiffer@universe-factory.net</email>
</author>
<published>2017-06-25T21:55:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7a3f4a185169b195c33f1c54f33a44eba2d6aa96'/>
<id>7a3f4a185169b195c33f1c54f33a44eba2d6aa96</id>
<content type='text'>
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
Acked-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
Acked-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: manual clean code which call skb_put_[data:zero]</title>
<updated>2017-06-20T17:30:15+00:00</updated>
<author>
<name>yuan linyu</name>
<email>Linyu.Yuan@alcatel-sbell.com.cn</email>
</author>
<published>2017-06-18T14:52:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b952f4dff2751252db073c27c0f8a16a416a2ddc'/>
<id>b952f4dff2751252db073c27c0f8a16a416a2ddc</id>
<content type='text'>
Signed-off-by: yuan linyu &lt;Linyu.Yuan@alcatel-sbell.com.cn&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: yuan linyu &lt;Linyu.Yuan@alcatel-sbell.com.cn&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hsr: fix incorrect warning</title>
<updated>2017-06-12T19:21:20+00:00</updated>
<author>
<name>Karicheri, Muralidharan</name>
<email>m-karicheri2@ti.com</email>
</author>
<published>2017-06-12T19:06:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=675c8da049fd6556eb2d6cdd745fe812752f07a8'/>
<id>675c8da049fd6556eb2d6cdd745fe812752f07a8</id>
<content type='text'>
When HSR interface is setup using ip link command, an annoying warning
appears with the trace as below:-

[  203.019828] hsr_get_node: Non-HSR frame
[  203.019833] Modules linked in:
[  203.019848] CPU: 0 PID: 158 Comm: sd-resolve Tainted: G        W       4.12.0-rc3-00052-g9fa6bf70 #2
[  203.019853] Hardware name: Generic DRA74X (Flattened Device Tree)
[  203.019869] [&lt;c0110280&gt;] (unwind_backtrace) from [&lt;c010c2f4&gt;] (show_stack+0x10/0x14)
[  203.019880] [&lt;c010c2f4&gt;] (show_stack) from [&lt;c04b9f64&gt;] (dump_stack+0xac/0xe0)
[  203.019894] [&lt;c04b9f64&gt;] (dump_stack) from [&lt;c01374e8&gt;] (__warn+0xd8/0x104)
[  203.019907] [&lt;c01374e8&gt;] (__warn) from [&lt;c0137548&gt;] (warn_slowpath_fmt+0x34/0x44)
root@am57xx-evm:~# [  203.019921] [&lt;c0137548&gt;] (warn_slowpath_fmt) from [&lt;c081126c&gt;] (hsr_get_node+0x148/0x170)
[  203.019932] [&lt;c081126c&gt;] (hsr_get_node) from [&lt;c0814240&gt;] (hsr_forward_skb+0x110/0x7c0)
[  203.019942] [&lt;c0814240&gt;] (hsr_forward_skb) from [&lt;c0811d64&gt;] (hsr_dev_xmit+0x2c/0x34)
[  203.019954] [&lt;c0811d64&gt;] (hsr_dev_xmit) from [&lt;c06c0828&gt;] (dev_hard_start_xmit+0xc4/0x3bc)
[  203.019963] [&lt;c06c0828&gt;] (dev_hard_start_xmit) from [&lt;c06c13d8&gt;] (__dev_queue_xmit+0x7c4/0x98c)
[  203.019974] [&lt;c06c13d8&gt;] (__dev_queue_xmit) from [&lt;c0782f54&gt;] (ip6_finish_output2+0x330/0xc1c)
[  203.019983] [&lt;c0782f54&gt;] (ip6_finish_output2) from [&lt;c0788f0c&gt;] (ip6_output+0x58/0x454)
[  203.019994] [&lt;c0788f0c&gt;] (ip6_output) from [&lt;c07b16cc&gt;] (mld_sendpack+0x420/0x744)

As this is an expected path to hsr_get_node() with frame coming from
the master interface, add a check to ensure packet is not from the
master port and then warn.

Signed-off-by: Murali Karicheri &lt;m-karicheri2@ti.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When HSR interface is setup using ip link command, an annoying warning
appears with the trace as below:-

[  203.019828] hsr_get_node: Non-HSR frame
[  203.019833] Modules linked in:
[  203.019848] CPU: 0 PID: 158 Comm: sd-resolve Tainted: G        W       4.12.0-rc3-00052-g9fa6bf70 #2
[  203.019853] Hardware name: Generic DRA74X (Flattened Device Tree)
[  203.019869] [&lt;c0110280&gt;] (unwind_backtrace) from [&lt;c010c2f4&gt;] (show_stack+0x10/0x14)
[  203.019880] [&lt;c010c2f4&gt;] (show_stack) from [&lt;c04b9f64&gt;] (dump_stack+0xac/0xe0)
[  203.019894] [&lt;c04b9f64&gt;] (dump_stack) from [&lt;c01374e8&gt;] (__warn+0xd8/0x104)
[  203.019907] [&lt;c01374e8&gt;] (__warn) from [&lt;c0137548&gt;] (warn_slowpath_fmt+0x34/0x44)
root@am57xx-evm:~# [  203.019921] [&lt;c0137548&gt;] (warn_slowpath_fmt) from [&lt;c081126c&gt;] (hsr_get_node+0x148/0x170)
[  203.019932] [&lt;c081126c&gt;] (hsr_get_node) from [&lt;c0814240&gt;] (hsr_forward_skb+0x110/0x7c0)
[  203.019942] [&lt;c0814240&gt;] (hsr_forward_skb) from [&lt;c0811d64&gt;] (hsr_dev_xmit+0x2c/0x34)
[  203.019954] [&lt;c0811d64&gt;] (hsr_dev_xmit) from [&lt;c06c0828&gt;] (dev_hard_start_xmit+0xc4/0x3bc)
[  203.019963] [&lt;c06c0828&gt;] (dev_hard_start_xmit) from [&lt;c06c13d8&gt;] (__dev_queue_xmit+0x7c4/0x98c)
[  203.019974] [&lt;c06c13d8&gt;] (__dev_queue_xmit) from [&lt;c0782f54&gt;] (ip6_finish_output2+0x330/0xc1c)
[  203.019983] [&lt;c0782f54&gt;] (ip6_finish_output2) from [&lt;c0788f0c&gt;] (ip6_output+0x58/0x454)
[  203.019994] [&lt;c0788f0c&gt;] (ip6_output) from [&lt;c07b16cc&gt;] (mld_sendpack+0x420/0x744)

As this is an expected path to hsr_get_node() with frame coming from
the master interface, add a check to ensure packet is not from the
master port and then warn.

Signed-off-by: Murali Karicheri &lt;m-karicheri2@ti.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Fix inconsistent teardown and release of private netdev state.</title>
<updated>2017-06-07T19:53:24+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2017-05-08T16:52:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cf124db566e6b036b8bcbe8decbed740bdfac8c6'/>
<id>cf124db566e6b036b8bcbe8decbed740bdfac8c6</id>
<content type='text'>
Network devices can allocate reasources and private memory using
netdev_ops-&gt;ndo_init().  However, the release of these resources
can occur in one of two different places.

Either netdev_ops-&gt;ndo_uninit() or netdev-&gt;destructor().

The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.

netdev_ops-&gt;ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.

netdev-&gt;destructor(), on the other hand, does not run until the
netdev references all go away.

Further complicating the situation is that netdev-&gt;destructor()
almost universally does also a free_netdev().

This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.

If netdev_ops-&gt;ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops-&gt;ndo_uninit().  But
it is not able to invoke netdev-&gt;destructor().

This is because netdev-&gt;destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.

However, this means that the resources that would normally be released
by netdev-&gt;destructor() will not be.

Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.

Many drivers do not try to deal with this, and instead we have leaks.

Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev-&gt;destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().

netdev-&gt;priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev-&gt;destructor(), except for
free_netdev().

netdev-&gt;needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().

Now, register_netdevice() can sanely release all resources after
ndo_ops-&gt;ndo_init() succeeds, by invoking both ndo_ops-&gt;ndo_uninit()
and netdev-&gt;priv_destructor().

And at the end of unregister_netdevice(), we invoke
netdev-&gt;priv_destructor() and optionally call free_netdev().

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Network devices can allocate reasources and private memory using
netdev_ops-&gt;ndo_init().  However, the release of these resources
can occur in one of two different places.

Either netdev_ops-&gt;ndo_uninit() or netdev-&gt;destructor().

The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.

netdev_ops-&gt;ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.

netdev-&gt;destructor(), on the other hand, does not run until the
netdev references all go away.

Further complicating the situation is that netdev-&gt;destructor()
almost universally does also a free_netdev().

This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.

If netdev_ops-&gt;ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops-&gt;ndo_uninit().  But
it is not able to invoke netdev-&gt;destructor().

This is because netdev-&gt;destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.

However, this means that the resources that would normally be released
by netdev-&gt;destructor() will not be.

Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.

Many drivers do not try to deal with this, and instead we have leaks.

Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev-&gt;destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().

netdev-&gt;priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev-&gt;destructor(), except for
free_netdev().

netdev-&gt;needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().

Now, register_netdevice() can sanely release all resources after
ndo_ops-&gt;ndo_init() succeeds, by invoking both ndo_ops-&gt;ndo_uninit()
and netdev-&gt;priv_destructor().

And at the end of unregister_netdevice(), we invoke
netdev-&gt;priv_destructor() and optionally call free_netdev().

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netlink: extended ACK reporting</title>
<updated>2017-04-13T17:58:20+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2017-04-12T12:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2d4bc93368f5a0ddb57c8c885cdad9c9b7a10ed5'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>net/hsr: use eth_hw_addr_random()</title>
<updated>2017-02-21T18:25:22+00:00</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2017-02-21T13:04:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d4af4c0ad0a4d070ef756010a2a10d96ff53d73d'/>
<id>d4af4c0ad0a4d070ef756010a2a10d96ff53d73d</id>
<content type='text'>
Use eth_hw_addr_random() to set a random MAC address in order to make sure
dev-&gt;addr_assign_type will be properly set to NET_ADDR_RANDOM.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use eth_hw_addr_random() to set a random MAC address in order to make sure
dev-&gt;addr_assign_type will be properly set to NET_ADDR_RANDOM.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net-next: treewide use is_vlan_dev() helper function.</title>
<updated>2017-02-06T21:33:29+00:00</updated>
<author>
<name>Parav Pandit</name>
<email>parav@mellanox.com</email>
</author>
<published>2017-02-04T17:00:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d0d7b10b05945f40fefd4e60f457c61aefa3e9a9'/>
<id>d0d7b10b05945f40fefd4e60f457c61aefa3e9a9</id>
<content type='text'>
This patch makes use of is_vlan_dev() function instead of flag
comparison which is exactly done by is_vlan_dev() helper function.

Signed-off-by: Parav Pandit &lt;parav@mellanox.com&gt;
Reviewed-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Acked-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Acked-by: Jon Maxwell &lt;jmaxwell37@gmail.com&gt;
Acked-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes use of is_vlan_dev() function instead of flag
comparison which is exactly done by is_vlan_dev() helper function.

Signed-off-by: Parav Pandit &lt;parav@mellanox.com&gt;
Reviewed-by: Daniel Jurgens &lt;danielj@mellanox.com&gt;
Acked-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Acked-by: Jon Maxwell &lt;jmaxwell37@gmail.com&gt;
Acked-by: Johannes Thumshirn &lt;jth@kernel.org&gt;
Acked-by: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2016-10-30T16:42:58+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2016-10-30T16:42:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=27058af401e49d88a905df000dd26f443fcfa8ce'/>
<id>27058af401e49d88a905df000dd26f443fcfa8ce</id>
<content type='text'>
Mostly simple overlapping changes.

For example, David Ahern's adjacency list revamp in 'net-next'
conflicted with an adjacency list traversal bug fix in 'net'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly simple overlapping changes.

For example, David Ahern's adjacency list revamp in 'net-next'
conflicted with an adjacency list traversal bug fix in 'net'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genetlink: mark families as __ro_after_init</title>
<updated>2016-10-27T20:16:09+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-10-24T12:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=56989f6d8568c21257dcec0f5e644d5570ba3281'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
</feed>
