lkml.org 
[lkml]   [2021]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 25/62] chtls: Added a check to avoid NULL pointer dereference
    Date
    From: Ayush Sawal <ayush.sawal@chelsio.com>

    [ Upstream commit eade1e0a4fb31d48eeb1589d9bb859ae4dd6181d ]

    In case of server removal lookup_stid() may return NULL pointer, which
    is used as listen_ctx. So added a check before accessing this pointer.

    Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition")
    Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
    Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/crypto/chelsio/chtls/chtls_cm.c | 5 +++++
    1 file changed, 5 insertions(+)

    --- a/drivers/crypto/chelsio/chtls/chtls_cm.c
    +++ b/drivers/crypto/chelsio/chtls/chtls_cm.c
    @@ -1453,6 +1453,11 @@ static int chtls_pass_establish(struct c
    sk_wake_async(sk, 0, POLL_OUT);

    data = lookup_stid(cdev->tids, stid);
    + if (!data) {
    + /* listening server close */
    + kfree_skb(skb);
    + goto unlock;
    + }
    lsk = ((struct listen_ctx *)data)->lsk;

    bh_lock_sock(lsk);

    \
     
     \ /
      Last update: 2021-01-15 13:58    [W:4.059 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site