]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: hold transport before we access t->asoc in sctp proc
authorXin Long <lucien.xin@gmail.com>
Thu, 21 Jan 2016 17:49:08 +0000 (01:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Jan 2016 23:59:32 +0000 (15:59 -0800)
commit61dffcb027721e4ad98b2f1c884db0595b5f93b5
tree22a304daa8d4cb74a609587a841e3f85a7b57348
parent80acda01ad2c804de207f547bd47fae34b0af5ee
sctp: hold transport before we access t->asoc in sctp proc

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 <lucien.xin@gmail.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/proc.c