<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/core/dev_addr_lists.c, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-04-19T16:58:20Z</updated>
<entry>
<title>net: change the comment of dev_mc_init</title>
<updated>2018-04-19T16:58:20Z</updated>
<author>
<name>sunlianwen</name>
<email>sunlw.fnst@cn.fujitsu.com</email>
</author>
<published>2018-04-18T01:22:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bb9aaaa1849eed763c6b7f20227a8a03300d4421'/>
<id>urn:sha1:bb9aaaa1849eed763c6b7f20227a8a03300d4421</id>
<content type='text'>
The comment of dev_mc_init() is wrong. which use dev_mc_flush
instead of dev_mc_init.

Signed-off-by: Lianwen Sun &lt;sunlw.fnst@cn.fujitsu.com
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix uninit-value in __hw_addr_add_ex()</title>
<updated>2018-04-08T02:32:31Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2018-04-07T20:42:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77d36398d99f2565c0a8d43a86fd520a82e64bb8'/>
<id>urn:sha1:77d36398d99f2565c0a8d43a86fd520a82e64bb8</id>
<content type='text'>
syzbot complained :

BUG: KMSAN: uninit-value in memcmp+0x119/0x180 lib/string.c:861
CPU: 0 PID: 3 Comm: kworker/0:0 Not tainted 4.16.0+ #82
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ipv6_addrconf addrconf_dad_work
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 memcmp+0x119/0x180 lib/string.c:861
 __hw_addr_add_ex net/core/dev_addr_lists.c:60 [inline]
 __dev_mc_add+0x1c2/0x8e0 net/core/dev_addr_lists.c:670
 dev_mc_add+0x6d/0x80 net/core/dev_addr_lists.c:687
 igmp6_group_added+0x2db/0xa00 net/ipv6/mcast.c:662
 ipv6_dev_mc_inc+0xe9e/0x1130 net/ipv6/mcast.c:914
 addrconf_join_solict net/ipv6/addrconf.c:2078 [inline]
 addrconf_dad_begin net/ipv6/addrconf.c:3828 [inline]
 addrconf_dad_work+0x427/0x2150 net/ipv6/addrconf.c:3954
 process_one_work+0x12c6/0x1f60 kernel/workqueue.c:2113
 worker_thread+0x113c/0x24f0 kernel/workqueue.c:2247
 kthread+0x539/0x720 kernel/kthread.c:239

Fixes: f001fde5eadd ("net: introduce a list of device addresses dev_addr_list (v6)")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: syzbot &lt;syzkaller@googlegroups.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix spelling for synchronized</title>
<updated>2014-11-18T20:26:32Z</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2014-11-17T21:04:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d2398dc7c78f32c50ee23a21ad9141e5e08a2ed'/>
<id>urn:sha1:1d2398dc7c78f32c50ee23a21ad9141e5e08a2ed</id>
<content type='text'>
Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Add support for device specific address syncing</title>
<updated>2014-06-02T17:40:54Z</updated>
<author>
<name>Alexander Duyck</name>
<email>alexander.h.duyck@intel.com</email>
</author>
<published>2014-05-29T01:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=670e5b8eaf85704742bc3cb1df51fdd3ce08fc15'/>
<id>urn:sha1:670e5b8eaf85704742bc3cb1df51fdd3ce08fc15</id>
<content type='text'>
This change provides a function to be used in order to break the
ndo_set_rx_mode call into a set of address add and remove calls.  The code
is based on the implementation of dev_uc_sync/dev_mc_sync.  Since they
essentially do the same thing but with only one dev I simply named my
functions __dev_uc_sync/__dev_mc_sync.

I also implemented an unsync version of the functions as well to allow for
cleanup on close.

Signed-off-by: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Correctly sync addresses from multiple sources to single device</title>
<updated>2014-01-23T21:06:34Z</updated>
<author>
<name>Vlad Yasevich</name>
<email>vyasevic@redhat.com</email>
</author>
<published>2014-01-22T17:54:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ef7b8a23a2022915a7e1ac1a7b847ded7d977b1'/>
<id>urn:sha1:6ef7b8a23a2022915a7e1ac1a7b847ded7d977b1</id>
<content type='text'>
When we have multiple devices attempting to sync the same address
to a single destination, each device should be permitted to sync
it once.  To accomplish this, pass the 'sync_cnt' of the source
address when adding the addresss to the lower device.  'sync_cnt'
tracks how many time a given address has been succefully synced.
This way, we know that if the 'sync_cnt' passed in is 0, we should
sync this address.

Also, turn 'synced' member back into the counter as was originally
done in
   commit 4543fbefe6e06a9e40d9f2b28d688393a299f079.
   net: count hw_addr syncs so that unsync works properly.
It tracks how many time a given address has been added via a
'sync' operation.  For every successfull 'sync' the counter is
incremented, and for ever 'unsync', the counter is decremented.
This makes sure that the address will be properly removed from
the the lower device when all the upper devices have removed it.

Reported-by: Andrey Dmitrov &lt;andrey.dmitrov@oktetlabs.ru&gt;
CC: Andrey Dmitrov &lt;andrey.dmitrov@oktetlabs.ru&gt;
CC: Alexandra N. Kossovsky &lt;Alexandra.Kossovsky@oktetlabs.ru&gt;
CC: Konstantin Ushakov &lt;Konstantin.Ushakov@oktetlabs.ru&gt;
Signed-off-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: remove dead code for add/del multiple</title>
<updated>2013-12-17T20:14:04Z</updated>
<author>
<name>stephen hemminger</name>
<email>shemming@brocade.com</email>
</author>
<published>2013-12-13T20:35:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=477bb93320cec7ae74d5ccfad4f2bfa0b28fbe90'/>
<id>urn:sha1:477bb93320cec7ae74d5ccfad4f2bfa0b28fbe90</id>
<content type='text'>
These function to manipulate multiple addresses are not used anywhere
in current net-next tree. Some out of tree code maybe using these but
too bad; they should submit their code upstream..

Also, make __hw_addr_flush local since only used by dev_addr_lists.c

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net, mc: fix the incorrect comments in two mc-related functions</title>
<updated>2013-10-29T04:19:05Z</updated>
<author>
<name>Zhi Yong Wu</name>
<email>wuzhy@linux.vnet.ibm.com</email>
</author>
<published>2013-10-28T08:15:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cdfb97bc010d9e9d994eb68f2cbac3a8ada26104'/>
<id>urn:sha1:cdfb97bc010d9e9d994eb68f2cbac3a8ada26104</id>
<content type='text'>
Signed-off-by: Zhi Yong Wu &lt;wuzhy@linux.vnet.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: dev_mc_sync_multiple calls wrong helper</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b190a50875b95e58ebe2b00ed3bf7f1d44961471'/>
<id>urn:sha1:b190a50875b95e58ebe2b00ed3bf7f1d44961471</id>
<content type='text'>
The dev_mc_sync_multiple function is currently calling
__hw_addr_sync, and not __hw_addr_sync_multiple.  This will result in
addresses only being synced to the first device from the set.

	Corrected by calling the _multiple variant.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: __hw_addr_sync_one / _multiple broken</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=29ca2f8fcc721517b83d0a560c47cee2dde827a6'/>
<id>urn:sha1:29ca2f8fcc721517b83d0a560c47cee2dde827a6</id>
<content type='text'>
Currently, __hw_addr_sync_one is called in a loop by
__hw_addr_sync_multiple to sync each of a "from" device's hw addresses
to a "to" device.  __hw_addr_sync_one calls __hw_addr_add_ex to attempt
to add each address.  __hw_addr_add_ex is called with global=false, and
sync=true.

	__hw_addr_add_ex checks to see if the new address matches an
address already on the list.  If so, it tests global and sync.  In this
case, sync=true, and it then checks if the address is already synced,
and if so, returns 0.

	This 0 return causes __hw_addr_sync_one to increment the sync_cnt
and refcount for the "from" list's address entry, even though the address
is already synced and has a reference and sync_cnt.  This will cause
the sync_cnt and refcount to increment without bound every time an
addresses is added to the "from" device and synced to the "to" device.

	The fix here has two parts:

	First, when __hw_addr_add_ex finds the address already exists
and is synced, return -EEXIST instead of 0.

	Second, __hw_addr_sync_one checks the error return for -EEXIST,
and if so, it (a) does not add a refcount/sync_cnt, and (b) returns 0
itself so that __hw_addr_sync_multiple will not return an error.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/core: __hw_addr_unsync_one "from" address not marked synced</title>
<updated>2013-05-31T23:56:56Z</updated>
<author>
<name>Jay Vosburgh</name>
<email>fubar@us.ibm.com</email>
</author>
<published>2013-05-31T11:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=60ba834c2fb65f2fafee47e03c258fac579d0591'/>
<id>urn:sha1:60ba834c2fb65f2fafee47e03c258fac579d0591</id>
<content type='text'>
When an address is added to a subordinate interface (the "to"
list), the address entry in the "from" list is not marked "synced" as
the entry added to the "to" list is.

	When performing the unsync operation (e.g., dev_mc_unsync),
__hw_addr_unsync_one calls __hw_addr_del_entry with the "synced"
parameter set to true for the case when the address reference is being
released from the "from" list.  This causes a test inside to fail,
with the result being that the reference count on the "from" address
is not properly decremeted and the address on the "from" list will
never be freed.

	Correct this by having __hw_addr_unsync_one call the
__hw_addr_del_entry function with the "sync" flag set to false for the
"remove from the from list" case.

Signed-off-by: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
Reviewed-by: Vlad Yasevich &lt;vyasevic@redhat.com&gt;
Tested-by: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
