<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sctp/proc.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-08-13T22:10:16Z</updated>
<entry>
<title>net/sctp: always initialise sctp_ht_iter::start_fail</title>
<updated>2016-08-13T22:10:16Z</updated>
<author>
<name>Vegard Nossum</name>
</author>
<published>2016-08-12T07:50:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54236ab09e9696a27baaae693c288920a26e8588'/>
<id>urn:sha1:54236ab09e9696a27baaae693c288920a26e8588</id>
<content type='text'>
sctp_transport_seq_start() does not currently clear iter-&gt;start_fail on
success, but relies on it being zero when it is allocated (by
seq_open_net()).

This can be a problem in the following sequence:

    open() // allocates iter (and implicitly sets iter-&gt;start_fail = 0)
    read()
     - iter-&gt;start() // fails and sets iter-&gt;start_fail = 1
     - iter-&gt;stop() // doesn't call sctp_transport_walk_stop() (correct)
    read() again
     - iter-&gt;start() // succeeds, but doesn't change iter-&gt;start_fail
     - iter-&gt;stop() // doesn't call sctp_transport_walk_stop() (wrong)

We should initialize sctp_ht_iter::start_fail to zero if -&gt;start()
succeeds, otherwise it's possible that we leave an old value of 1 there,
which will cause -&gt;stop() to not call sctp_transport_walk_stop(), which
causes all sorts of problems like not calling rcu_read_unlock() (and
preempt_enable()), eventually leading to more warnings like this:

    BUG: sleeping function called from invalid context at mm/slab.h:388
    in_atomic(): 0, irqs_disabled(): 0, pid: 16551, name: trinity-c2
    Preemption disabled at:[&lt;ffffffff819bceb6&gt;] rhashtable_walk_start+0x46/0x150

     [&lt;ffffffff81149abb&gt;] preempt_count_add+0x1fb/0x280
     [&lt;ffffffff83295892&gt;] _raw_spin_lock+0x12/0x40
     [&lt;ffffffff819bceb6&gt;] rhashtable_walk_start+0x46/0x150
     [&lt;ffffffff82ec665f&gt;] sctp_transport_walk_start+0x2f/0x60
     [&lt;ffffffff82edda1d&gt;] sctp_transport_seq_start+0x4d/0x150
     [&lt;ffffffff81439e50&gt;] traverse+0x170/0x850
     [&lt;ffffffff8143aeec&gt;] seq_read+0x7cc/0x1180
     [&lt;ffffffff814f996c&gt;] proc_reg_read+0xbc/0x180
     [&lt;ffffffff813d0384&gt;] do_loop_readv_writev+0x134/0x210
     [&lt;ffffffff813d2a95&gt;] do_readv_writev+0x565/0x660
     [&lt;ffffffff813d6857&gt;] vfs_readv+0x67/0xa0
     [&lt;ffffffff813d6c16&gt;] do_preadv+0x126/0x170
     [&lt;ffffffff813d710c&gt;] SyS_preadv+0xc/0x10
     [&lt;ffffffff8100334c&gt;] do_syscall_64+0x19c/0x410
     [&lt;ffffffff83296225&gt;] return_from_SYSCALL_64+0x0/0x6a
     [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

Notice that this is a subtly different stacktrace from the one in commit
5fc382d875 ("net/sctp: terminate rhashtable walk correctly").

Cc: Xin Long &lt;lucien.xin@gmail.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Acked-By: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Acked-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: fix some rhashtable functions using in sctp proc/diag</title>
<updated>2016-04-15T21:29:37Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-04-14T07:35:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53fa10369c45a51947f06e8b622d2fa2cc64fda1'/>
<id>urn:sha1:53fa10369c45a51947f06e8b622d2fa2cc64fda1</id>
<content type='text'>
When rhashtable_walk_init return err, no release function should be
called, and when rhashtable_walk_start return err, we should only invoke
rhashtable_walk_exit to release the source.

But now when sctp_transport_walk_start return err, we just call
rhashtable_walk_stop/exit, and never care about if rhashtable_walk_init
or start return err, which is so bad.

We will fix it by calling rhashtable_walk_exit if rhashtable_walk_start
return err in sctp_transport_walk_start, and if sctp_transport_walk_start
return err, we do not need to call sctp_transport_walk_stop any more.

For sctp proc, we will use 'iter-&gt;start_fail' to decide if we will call
rhashtable_walk_stop/exit.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: merge the seq_start/next/exits in remaddrs and assocs</title>
<updated>2016-04-15T21:29:36Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-04-14T07:35:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5e2f4e6998a2b999da8fa0290b692f0bd85c8b7'/>
<id>urn:sha1:b5e2f4e6998a2b999da8fa0290b692f0bd85c8b7</id>
<content type='text'>
In sctp proc, these three functions in remaddrs and assocs are the
same. we should merge them into one.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: export some apis or variables for sctp_diag and reuse some for proc</title>
<updated>2016-04-15T21:29:36Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-04-14T07:35:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=626d16f50f39bb9c44f98fd256cae2b864900a01'/>
<id>urn:sha1:626d16f50f39bb9c44f98fd256cae2b864900a01</id>
<content type='text'>
For some main variables in sctp.ko, we couldn't export it to other modules,
so we have to define some api to access them.

It will include sctp transport and endpoint's traversal.

There are some transport traversal functions for sctp_diag, we can also
use it for sctp_proc. cause they have the similar situation to traversal
transport.

v2-&gt;v3:
- rhashtable_walk_init need the parameter gfp, because of recent upstrem
  update

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rhashtable: accept GFP flags in rhashtable_walk_init</title>
<updated>2016-04-05T08:56:32Z</updated>
<author>
<name>Bob Copeland</name>
</author>
<published>2016-03-02T15:09:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8f6fd83c6c5ec66a4a70c728535ddcdfef4f3697'/>
<id>urn:sha1:8f6fd83c6c5ec66a4a70c728535ddcdfef4f3697</id>
<content type='text'>
In certain cases, the 802.11 mesh pathtable code wants to
iterate over all of the entries in the forwarding table from
the receive path, which is inside an RCU read-side critical
section.  Enable walks inside atomic sections by allowing
GFP_ATOMIC allocations for the walker state.

Change all existing callsites to pass in GFP_KERNEL.

Acked-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Bob Copeland &lt;me@bobcopeland.com&gt;
[also adjust gfs2/glock.c and rhashtable tests]
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2016-03-08T17:34:12Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2016-03-08T17:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=810813c47a564416f6306ae214e2661366c987a7'/>
<id>urn:sha1:810813c47a564416f6306ae214e2661366c987a7</id>
<content type='text'>
Several cases of overlapping changes, as well as one instance
(vxlan) of a bug fix in 'net' overlapping with code movement
in 'net-next'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: sctp_remaddr_seq_show use the wrong variable to dump transport info</title>
<updated>2016-03-01T22:35:44Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-02-28T02:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d73e8fac8f84942f15307d6d9cb1dba843d3fb2'/>
<id>urn:sha1:3d73e8fac8f84942f15307d6d9cb1dba843d3fb2</id>
<content type='text'>
Now in sctp_remaddr_seq_show(), we use variable *tsp to get the param *v.
but *tsp is also used to traversal transport_addr_list, which will cover
the previous value, and make sctp_transport_put work on the wrong transport.

So fix it by adding a new variable to get the param *v.

Fixes: fba4c330c5b9 ("sctp: hold transport before we access t-&gt;asoc in sctp proc")
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: remove rcu_read_lock in sctp_seq_dump_remote_addrs()</title>
<updated>2016-02-17T20:41:54Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-02-15T06:28:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac1efde8022acf705c4b8393d5ee4b070594ba88'/>
<id>urn:sha1:ac1efde8022acf705c4b8393d5ee4b070594ba88</id>
<content type='text'>
sctp_seq_dump_remote_addrs is only called by sctp_assocs_seq_show()
and it has been protected by rcu_read_lock that is from
rhashtable_walk_start().

So we will remove this one.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: remove the dead field of sctp_transport</title>
<updated>2016-01-28T23:59:32Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-01-21T17:49:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47faa1e4c50ec26e6e75dcd1ce53f064bd45f729'/>
<id>urn:sha1:47faa1e4c50ec26e6e75dcd1ce53f064bd45f729</id>
<content type='text'>
After we use refcnt to check if transport is alive, the dead can be
removed from sctp_transport.

The traversal of transport_addr_list in procfs dump is using
list_for_each_entry_rcu, no need to check if it has been freed.

sctp_generate_t3_rtx_event and sctp_generate_heartbeat_event is
protected by sock lock, it's not necessary to check dead, either.
also, the timers are cancelled when sctp_transport_free() is
called, that it doesn't wait for refcnt to reach 0 to cancel them.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: hold transport before we access t-&gt;asoc in sctp proc</title>
<updated>2016-01-28T23:59:32Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2016-01-21T17:49:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fba4c330c5b9d1beeae08a42ed4430f5055e7f27'/>
<id>urn:sha1:fba4c330c5b9d1beeae08a42ed4430f5055e7f27</id>
<content type='text'>
Previously, before rhashtable, /proc assoc listing was done by
read-locking the entire hash entry and dumping all assocs at once, so we
were sure that the assoc wasn't freed because it wouldn't be possible to
remove it from the hash meanwhile.

Now we use rhashtable to list transports, and dump entries one by one.
That is, now we have to check if the assoc is still a good one, as the
transport we got may be being freed.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Reviewed-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
