<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/ipv4/fib_semantics.c, branch v3.2.73</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ipv4: fix nexthop attlen check in fib_nh_match</title>
<updated>2015-01-01T01:27:52+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2014-10-13T14:34:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0aba46add2915b344580569e87d9c41274b9c475'/>
<id>0aba46add2915b344580569e87d9c41274b9c475</id>
<content type='text'>
commit f76936d07c4eeb36d8dbb64ebd30ab46ff85d9f7 upstream.

fib_nh_match does not match nexthops correctly. Example:

ip route add 172.16.10/24 nexthop via 192.168.122.12 dev eth0 \
                          nexthop via 192.168.122.13 dev eth0
ip route del 172.16.10/24 nexthop via 192.168.122.14 dev eth0 \
                          nexthop via 192.168.122.15 dev eth0

Del command is successful and route is removed. After this patch
applied, the route is correctly matched and result is:
RTNETLINK answers: No such process

Please consider this for stable trees as well.

Fixes: 4e902c57417c4 ("[IPv4]: FIB configuration using struct fib_config")
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f76936d07c4eeb36d8dbb64ebd30ab46ff85d9f7 upstream.

fib_nh_match does not match nexthops correctly. Example:

ip route add 172.16.10/24 nexthop via 192.168.122.12 dev eth0 \
                          nexthop via 192.168.122.13 dev eth0
ip route del 172.16.10/24 nexthop via 192.168.122.14 dev eth0 \
                          nexthop via 192.168.122.15 dev eth0

Del command is successful and route is removed. After this patch
applied, the route is correctly matched and result is:
RTNETLINK answers: No such process

Please consider this for stable trees as well.

Fixes: 4e902c57417c4 ("[IPv4]: FIB configuration using struct fib_config")
Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: fib_semantics: increment fib_info_cnt after fib_info allocation</title>
<updated>2014-06-09T12:28:59+00:00</updated>
<author>
<name>Sergey Popovich</name>
<email>popovich_sergei@mail.ru</email>
</author>
<published>2014-05-06T15:23:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2157fbf160aa15f1f97fdb14261a3b1d3796b0fb'/>
<id>2157fbf160aa15f1f97fdb14261a3b1d3796b0fb</id>
<content type='text'>
[ Upstream commit aeefa1ecfc799b0ea2c4979617f14cecd5cccbfd ]

Increment fib_info_cnt in fib_create_info() right after successfuly
alllocating fib_info structure, overwise fib_metrics allocation failure
leads to fib_info_cnt incorrectly decremented in free_fib_info(), called
on error path from fib_create_info().

Signed-off-by: Sergey Popovich &lt;popovich_sergei@mail.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit aeefa1ecfc799b0ea2c4979617f14cecd5cccbfd ]

Increment fib_info_cnt in fib_create_info() right after successfuly
alllocating fib_info structure, overwise fib_metrics allocation failure
leads to fib_info_cnt incorrectly decremented in free_fib_info(), called
on error path from fib_create_info().

Signed-off-by: Sergey Popovich &lt;popovich_sergei@mail.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: fix the rcu race between free_fib_info and ip_route_output_slow</title>
<updated>2012-06-10T13:42:02+00:00</updated>
<author>
<name>Yanmin Zhang</name>
<email>yanmin_zhang@linux.intel.com</email>
</author>
<published>2012-05-23T15:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4a590034d6d5d5863d3f9a1915452026ee031a93'/>
<id>4a590034d6d5d5863d3f9a1915452026ee031a93</id>
<content type='text'>
[ Upstream commit e49cc0da7283088c5e03d475ffe2fdcb24a6d5b1 ]

We hit a kernel OOPS.

&lt;3&gt;[23898.789643] BUG: sleeping function called from invalid context at
/data/buildbot/workdir/ics/hardware/intel/linux-2.6/arch/x86/mm/fault.c:1103
&lt;3&gt;[23898.862215] in_atomic(): 0, irqs_disabled(): 0, pid: 10526, name:
Thread-6683
&lt;4&gt;[23898.967805] HSU serial 0000:00:05.1: 0000:00:05.2:HSU serial prevented me
to suspend...
&lt;4&gt;[23899.258526] Pid: 10526, comm: Thread-6683 Tainted: G        W
3.0.8-137685-ge7742f9 #1
&lt;4&gt;[23899.357404] HSU serial 0000:00:05.1: 0000:00:05.2:HSU serial prevented me
to suspend...
&lt;4&gt;[23899.904225] Call Trace:
&lt;4&gt;[23899.989209]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.000416]  [&lt;c1238c2a&gt;] __might_sleep+0x10a/0x110
&lt;4&gt;[23900.007357]  [&lt;c1228021&gt;] do_page_fault+0xd1/0x3c0
&lt;4&gt;[23900.013764]  [&lt;c18e9ba9&gt;] ? restore_all+0xf/0xf
&lt;4&gt;[23900.024024]  [&lt;c17c007b&gt;] ? napi_complete+0x8b/0x690
&lt;4&gt;[23900.029297]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.123739]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.128955]  [&lt;c18ea0c3&gt;] error_code+0x5f/0x64
&lt;4&gt;[23900.133466]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.138450]  [&lt;c17f6298&gt;] ? __ip_route_output_key+0x698/0x7c0
&lt;4&gt;[23900.144312]  [&lt;c17f5f8d&gt;] ? __ip_route_output_key+0x38d/0x7c0
&lt;4&gt;[23900.150730]  [&lt;c17f63df&gt;] ip_route_output_flow+0x1f/0x60
&lt;4&gt;[23900.156261]  [&lt;c181de58&gt;] ip4_datagram_connect+0x188/0x2b0
&lt;4&gt;[23900.161960]  [&lt;c18e981f&gt;] ? _raw_spin_unlock_bh+0x1f/0x30
&lt;4&gt;[23900.167834]  [&lt;c18298d6&gt;] inet_dgram_connect+0x36/0x80
&lt;4&gt;[23900.173224]  [&lt;c14f9e88&gt;] ? _copy_from_user+0x48/0x140
&lt;4&gt;[23900.178817]  [&lt;c17ab9da&gt;] sys_connect+0x9a/0xd0
&lt;4&gt;[23900.183538]  [&lt;c132e93c&gt;] ? alloc_file+0xdc/0x240
&lt;4&gt;[23900.189111]  [&lt;c123925d&gt;] ? sub_preempt_count+0x3d/0x50

Function free_fib_info resets nexthop_nh-&gt;nh_dev to NULL before releasing
fi. Other cpu might be accessing fi. Fixing it by delaying the releasing.

With the patch, we ran MTBF testing on Android mobile for 12 hours
and didn't trigger the issue.

Thank Eric for very detailed review/checking the issue.

Signed-off-by: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Kun Jiang &lt;kunx.jiang@intel.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit e49cc0da7283088c5e03d475ffe2fdcb24a6d5b1 ]

We hit a kernel OOPS.

&lt;3&gt;[23898.789643] BUG: sleeping function called from invalid context at
/data/buildbot/workdir/ics/hardware/intel/linux-2.6/arch/x86/mm/fault.c:1103
&lt;3&gt;[23898.862215] in_atomic(): 0, irqs_disabled(): 0, pid: 10526, name:
Thread-6683
&lt;4&gt;[23898.967805] HSU serial 0000:00:05.1: 0000:00:05.2:HSU serial prevented me
to suspend...
&lt;4&gt;[23899.258526] Pid: 10526, comm: Thread-6683 Tainted: G        W
3.0.8-137685-ge7742f9 #1
&lt;4&gt;[23899.357404] HSU serial 0000:00:05.1: 0000:00:05.2:HSU serial prevented me
to suspend...
&lt;4&gt;[23899.904225] Call Trace:
&lt;4&gt;[23899.989209]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.000416]  [&lt;c1238c2a&gt;] __might_sleep+0x10a/0x110
&lt;4&gt;[23900.007357]  [&lt;c1228021&gt;] do_page_fault+0xd1/0x3c0
&lt;4&gt;[23900.013764]  [&lt;c18e9ba9&gt;] ? restore_all+0xf/0xf
&lt;4&gt;[23900.024024]  [&lt;c17c007b&gt;] ? napi_complete+0x8b/0x690
&lt;4&gt;[23900.029297]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.123739]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.128955]  [&lt;c18ea0c3&gt;] error_code+0x5f/0x64
&lt;4&gt;[23900.133466]  [&lt;c1227f50&gt;] ? pgtable_bad+0x130/0x130
&lt;4&gt;[23900.138450]  [&lt;c17f6298&gt;] ? __ip_route_output_key+0x698/0x7c0
&lt;4&gt;[23900.144312]  [&lt;c17f5f8d&gt;] ? __ip_route_output_key+0x38d/0x7c0
&lt;4&gt;[23900.150730]  [&lt;c17f63df&gt;] ip_route_output_flow+0x1f/0x60
&lt;4&gt;[23900.156261]  [&lt;c181de58&gt;] ip4_datagram_connect+0x188/0x2b0
&lt;4&gt;[23900.161960]  [&lt;c18e981f&gt;] ? _raw_spin_unlock_bh+0x1f/0x30
&lt;4&gt;[23900.167834]  [&lt;c18298d6&gt;] inet_dgram_connect+0x36/0x80
&lt;4&gt;[23900.173224]  [&lt;c14f9e88&gt;] ? _copy_from_user+0x48/0x140
&lt;4&gt;[23900.178817]  [&lt;c17ab9da&gt;] sys_connect+0x9a/0xd0
&lt;4&gt;[23900.183538]  [&lt;c132e93c&gt;] ? alloc_file+0xdc/0x240
&lt;4&gt;[23900.189111]  [&lt;c123925d&gt;] ? sub_preempt_count+0x3d/0x50

Function free_fib_info resets nexthop_nh-&gt;nh_dev to NULL before releasing
fi. Other cpu might be accessing fi. Fixing it by delaying the releasing.

With the patch, we ran MTBF testing on Android mobile for 12 hours
and didn't trigger the issue.

Thank Eric for very detailed review/checking the issue.

Signed-off-by: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Kun Jiang &lt;kunx.jiang@intel.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: Fix fib_info-&gt;fib_metrics leak</title>
<updated>2011-09-16T21:42:26+00:00</updated>
<author>
<name>Yan, Zheng</name>
<email>zheng.z.yan@intel.com</email>
</author>
<published>2011-09-04T20:24:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=19c1ea14c930db5e9c0cd7c3c6f4d01457dfcd69'/>
<id>19c1ea14c930db5e9c0cd7c3c6f4d01457dfcd69</id>
<content type='text'>
Commit 4670994d(net,rcu: convert call_rcu(fc_rport_free_rcu) to
kfree_rcu()) introduced a memory leak. This patch reverts it.

Signed-off-by: Zheng Yan &lt;zheng.z.yan@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>
Commit 4670994d(net,rcu: convert call_rcu(fc_rport_free_rcu) to
kfree_rcu()) introduced a memory leak. This patch reverts it.

Signed-off-by: Zheng Yan &lt;zheng.z.yan@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net,rcu: convert call_rcu(fc_rport_free_rcu) to kfree_rcu()</title>
<updated>2011-05-08T05:50:55+00:00</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2011-03-18T03:42:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4670994d150a86ebd53ab353a2af517c5465bfaf'/>
<id>4670994d150a86ebd53ab353a2af517c5465bfaf</id>
<content type='text'>
The rcu callback fc_rport_free_rcu() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(fc_rport_free_rcu).

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The rcu callback fc_rport_free_rcu() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(fc_rport_free_rcu).

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: Fix nexthop caching wrt. scoping.</title>
<updated>2011-03-25T01:06:47+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-03-25T01:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37e826c513883099c298317bad1b3b677b2905fb'/>
<id>37e826c513883099c298317bad1b3b677b2905fb</id>
<content type='text'>
Move the scope value out of the fib alias entries and into fib_info,
so that we always use the correct scope when recomputing the nexthop
cached source address.

Reported-by: Julian Anastasov &lt;ja@ssi.bg&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>
Move the scope value out of the fib alias entries and into fib_info,
so that we always use the correct scope when recomputing the nexthop
cached source address.

Reported-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: Invalidate nexthop cache nh_saddr more correctly.</title>
<updated>2011-03-25T00:42:21+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-03-25T00:42:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=436c3b66ec9824a633724ae42de1c416af4f2063'/>
<id>436c3b66ec9824a633724ae42de1c416af4f2063</id>
<content type='text'>
Any operation that:

1) Brings up an interface
2) Adds an IP address to an interface
3) Deletes an IP address from an interface

can potentially invalidate the nh_saddr value, requiring
it to be recomputed.

Perform the recomputation lazily using a generation ID.

Reported-by: Julian Anastasov &lt;ja@ssi.bg&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>
Any operation that:

1) Brings up an interface
2) Adds an IP address to an interface
3) Deletes an IP address from an interface

can potentially invalidate the nh_saddr value, requiring
it to be recomputed.

Perform the recomputation lazily using a generation ID.

Reported-by: Julian Anastasov &lt;ja@ssi.bg&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: fix fib metrics</title>
<updated>2011-03-24T18:49:54+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-03-24T07:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fcd13f42c9d6ab7b1024b9b7125a2e8db3cc00b2'/>
<id>fcd13f42c9d6ab7b1024b9b7125a2e8db3cc00b2</id>
<content type='text'>
Alessandro Suardi reported that we could not change route metrics :

ip ro change default .... advmss 1400

This regression came with commit 9c150e82ac50 (Allocate fib metrics
dynamically). fib_metrics is no longer an array, but a pointer to an
array.

Reported-by: Alessandro Suardi &lt;alessandro.suardi@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Tested-by: Alessandro Suardi &lt;alessandro.suardi@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>
Alessandro Suardi reported that we could not change route metrics :

ip ro change default .... advmss 1400

This regression came with commit 9c150e82ac50 (Allocate fib metrics
dynamically). fib_metrics is no longer an array, but a pointer to an
array.

Reported-by: Alessandro Suardi &lt;alessandro.suardi@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Tested-by: Alessandro Suardi &lt;alessandro.suardi@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: Use flowi4 in FIB layer.</title>
<updated>2011-03-12T23:08:49+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-03-12T07:02:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9ade22861f922344788321e374c542c92bc049b6'/>
<id>9ade22861f922344788321e374c542c92bc049b6</id>
<content type='text'>
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: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: Pass ipv4 flow objects into fib_lookup() paths.</title>
<updated>2011-03-12T23:08:47+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-03-12T00:54:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=22bd5b9b13f2931ac80949f8bfbc40e8cab05be7'/>
<id>22bd5b9b13f2931ac80949f8bfbc40e8cab05be7</id>
<content type='text'>
To start doing these conversions, we need to add some temporary
flow4_* macros which will eventually go away when all the protocol
code paths are changed to work on AF specific flowi objects.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To start doing these conversions, we need to add some temporary
flow4_* macros which will eventually go away when all the protocol
code paths are changed to work on AF specific flowi objects.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
