]> git.baikalelectronics.ru Git - kernel.git/commit
net: sctp: sctp_transport_destroy{, _rcu}: fix potential pointer corruption
authorDaniel Borkmann <dborkman@redhat.com>
Fri, 9 Aug 2013 14:25:21 +0000 (16:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Aug 2013 05:13:47 +0000 (22:13 -0700)
commit378f9b81a1f6593c944d98e918cc5ba69c9a5127
treed303a22b45461e2d728dd1e59dfce9bb38cf3e8f
parent20b8e1efe67edcba34208e8fc9b4439de39bc0ec
net: sctp: sctp_transport_destroy{, _rcu}: fix potential pointer corruption

Probably this one is quite unlikely to be triggered, but it's more safe
to do the call_rcu() at the end after we have dropped the reference on
the asoc and freed sctp packet chunks. The reason why is because in
sctp_transport_destroy_rcu() the transport is being kfree()'d, and if
we're unlucky enough we could run into corrupted pointers. Probably
that's more of theoretical nature, but it's safer to have this simple fix.

Introduced by commit 72c4f188 ("sctp: sctp_close: fix release of bindings
for deferred call_rcu's"). I also did the 72c4f188 regression test and
it's fine that way.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/transport.c