<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/net/sctp/proc.c, branch master</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2017-07-01T14:39:08+00:00</updated>
<entry>
<title>net: convert sock.sk_wmem_alloc from atomic_t to refcount_t</title>
<updated>2017-07-01T14:39:08+00:00</updated>
<author>
<name>Reshetova, Elena</name>
<email>elena.reshetova@intel.com</email>
</author>
<published>2017-06-30T10:08:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=14afee4b6092fde451ee17604e5f5c89da33e71e'/>
<id>urn:sha1:14afee4b6092fde451ee17604e5f5c89da33e71e</id>
<content type='text'>
refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.

Signed-off-by: Elena Reshetova &lt;elena.reshetova@intel.com&gt;
Signed-off-by: Hans Liljestrand &lt;ishkamiel@gmail.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: David Windsor &lt;dwindsor@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: use read_lock_bh in sctp_eps_seq_show</title>
<updated>2017-06-10T20:22:26+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2017-06-10T07:13:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c0a4c2d1cde70d876da3f5a76a7284abf8d1800a'/>
<id>urn:sha1:c0a4c2d1cde70d876da3f5a76a7284abf8d1800a</id>
<content type='text'>
This patch is to use read_lock_bh instead of local_bh_disable
and read_lock in sctp_eps_seq_show.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.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: define the member stream as an object instead of pointer in asoc</title>
<updated>2017-06-02T17:56:26+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2017-05-31T08:36:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=cee360ab4dd66fc1de33a5fa1cb418fa21c27ce3'/>
<id>urn:sha1:cee360ab4dd66fc1de33a5fa1cb418fa21c27ce3</id>
<content type='text'>
As Marcelo's suggestion, stream is a fixed size member of asoc and would
not grow with more streams. To avoid an allocation for it, this patch is
to define it as an object instead of pointer and update the places using
it, also create sctp_stream_update() called in sctp_assoc_update() to
migrate the stream info from one stream to another.

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: use right in and out stream cnt</title>
<updated>2017-04-02T03:12:30+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2017-03-31T09:57:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=afe89962ee0799955b606cc7637ac86a296923a6'/>
<id>urn:sha1:afe89962ee0799955b606cc7637ac86a296923a6</id>
<content type='text'>
Since sctp reconf was added in sctp, the real cnt of in/out stream
have not been c.sinit_max_instreams and c.sinit_num_ostreams any
more.

This patch is to replace them with stream-&gt;in/outcnt.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.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>net: Suppress the "Comparison to NULL could be written" warnings</title>
<updated>2016-09-30T05:50:45+00:00</updated>
<author>
<name>Jia He</name>
<email>hejianet@gmail.com</email>
</author>
<published>2016-09-30T03:29:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6d4a741cbbfa6612a479656654ca5edf7becc72c'/>
<id>urn:sha1:6d4a741cbbfa6612a479656654ca5edf7becc72c</id>
<content type='text'>
This is to suppress the checkpatch.pl warning "Comparison to NULL
could be written". No functional changes here.

Signed-off-by: Jia He &lt;hejianet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>proc: Reduce cache miss in sctp_snmp_seq_show</title>
<updated>2016-09-30T05:50:44+00:00</updated>
<author>
<name>Jia He</name>
<email>hejianet@gmail.com</email>
</author>
<published>2016-09-30T03:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=7d64a94be2f9fadb1dd95742650f1fdbac69f25b'/>
<id>urn:sha1:7d64a94be2f9fadb1dd95742650f1fdbac69f25b</id>
<content type='text'>
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to
aggregate the data by going through all the items of each cpu sequentially.

Signed-off-by: Jia He &lt;hejianet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/sctp: always initialise sctp_ht_iter::start_fail</title>
<updated>2016-08-13T22:10:16+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@oracle.com</email>
</author>
<published>2016-08-12T07:50:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.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:37+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2016-04-14T07:35:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.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:36+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2016-04-14T07:35:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.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:36+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2016-04-14T07:35:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.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>
</feed>
