lkml.org 
[lkml]   [2017]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH RT 14/15] net: use trylock in icmp_sk
    4.9.65-rt57-rc2 stable review patch.
    If anyone has any objections, please let me know.

    ------------------

    From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

    The locking path can be recursive (same as for sk->sk_lock.slock) and
    therefore we need a trylock version for the locallock, too.

    Cc: rt-stable@vger.kernel.org
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    ---
    net/ipv4/icmp.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
    index e6864ff11352..330224ef4174 100644
    --- a/net/ipv4/icmp.c
    +++ b/net/ipv4/icmp.c
    @@ -219,7 +219,11 @@ static inline struct sock *icmp_xmit_lock(struct net *net)

    local_bh_disable();

    - local_lock(icmp_sk_lock);
    + if (!local_trylock(icmp_sk_lock)) {
    + local_bh_enable();
    + return NULL;
    + }
    +
    sk = icmp_sk(net);

    if (unlikely(!spin_trylock(&sk->sk_lock.slock))) {
    --
    2.13.2

    \
     
     \ /
      Last update: 2017-12-02 01:08    [W:4.403 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site