diff options
author | David S. Miller <davem@davemloft.net> | 2017-04-02 05:16:42 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-02 05:16:42 +0200 |
commit | e5c1e5198068ed896a8a80b8ed9e202bbab18851 (patch) | |
tree | 7143c7c597ae638f5b9587c576824e8aec91523d /drivers/virt | |
parent | sctp: use right in and out stream cnt (diff) | |
parent | l2tp: take a reference on sessions used in genetlink handlers (diff) | |
download | linux-e5c1e5198068ed896a8a80b8ed9e202bbab18851.tar.xz linux-e5c1e5198068ed896a8a80b8ed9e202bbab18851.zip |
Merge branch 'l2tp_session_find-fixes'
Guillaume Nault says:
====================
l2tp: fix usage of l2tp_session_find()
l2tp_session_find() doesn't take a reference on the session returned to
its caller. Virtually all l2tp_session_find() users are racy, either
because the session can disappear from under them or because they take
a reference too late. This leads to bugs like 'use after free' or
failure to notice duplicate session creations.
In some cases, taking a reference on the session is not enough. The
special callbacks .ref() and .deref() also have to be called in cases
where the PPP pseudo-wire uses the socket associated with the session.
Therefore, when looking up a session, we also have to pass a flag
indicating if the .ref() callback has to be called.
In the future, we probably could drop the .ref() and .deref() callbacks
entirely by protecting the .sock field of struct pppol2tp_session with
RCU, thus allowing it to be freed and set to NULL even if the L2TP
session is still alive.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/virt')
0 files changed, 0 insertions, 0 deletions