From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A181C282C2 for ; Thu, 7 Feb 2019 13:37:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB256206DD for ; Thu, 7 Feb 2019 13:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727076AbfBGNhi (ORCPT ); Thu, 7 Feb 2019 08:37:38 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51831 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbfBGNhi (ORCPT ); Thu, 7 Feb 2019 08:37:38 -0500 Received: by mail-wm1-f66.google.com with SMTP id b11so6138460wmj.1 for ; Thu, 07 Feb 2019 05:37:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ij8Kw9PNnmfbaVSFrX8Q9mVuS+8VgFFaGuZgIIVxK3E=; b=M1byj1tlzr3PdHTxhQYsA9zNsd3bn29gguDqijF+mATvPNXtZaKxjEZrGZlR/Hm6ec xRxK5tL53xei1knpturHoVqNPlS/PUCbZjGVvdsnWiL8LWAQ1R8iZ7Z1I698n/wZvoxV lEFLBh1XJwqffwqz/fxHKtmq7/G3L3oiHUuc3fxqY5PpmulasG4Ave+yuKzyZPeAxFfB TGNdCWe3jrqQ1/ApcY72CVZRj0cg8QIjZkZxWINiwAc8Og4h6H5NcdaiY3/W/5rT7MkD 9LLBm/Bg6AHy9o4ZGYKpy7+vpQq+qev1KZ8mnV5UG0pNKfOzJ95OqOVWwTPDuLvVlXHN 3S5Q== X-Gm-Message-State: AHQUAuamZ+9GfSisFXYPaf8D08R/ypOF8Tsle7KgbHBltL1eie6t90mJ /K9IfUpkj0LYl4Z2BPYwByFbDw== X-Google-Smtp-Source: AHgI3IbAkC4aaXerjzrKA9zIEJzmy5f5Ot/9glvnuNhjdiR7aiPU83e4eXPU268o0VrRtuzuMFPQ5A== X-Received: by 2002:a1c:e3d7:: with SMTP id a206mr7138205wmh.12.1549546656740; Thu, 07 Feb 2019 05:37:36 -0800 (PST) Received: from steredhat (host209-202-dynamic.46-79-r.retail.telecomitalia.it. [79.46.202.209]) by smtp.gmail.com with ESMTPSA id h62sm23238534wmf.11.2019.02.07.05.37.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 05:37:35 -0800 (PST) Date: Thu, 7 Feb 2019 14:37:33 +0100 From: Stefano Garzarella To: Paolo Abeni Cc: netdev@vger.kernel.org, "David S. Miller" , Jorgen Hansen Subject: Re: [PATCH net] vsock: cope with memory allocation failure at socket creation time Message-ID: <20190207133733.bskvbvekrdm2244v@steredhat> References: <9ad578fedcc2888319e4ec222d11f6fe51afd613.1549545195.git.pabeni@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ad578fedcc2888319e4ec222d11f6fe51afd613.1549545195.git.pabeni@redhat.com> User-Agent: NeoMutt/20180716 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Feb 07, 2019 at 02:13:18PM +0100, Paolo Abeni wrote: > In the unlikely event that the kmalloc call in vmci_transport_socket_init() > fails, we end-up calling vmci_transport_destruct() with a NULL vmci_trans() > and oopsing. > > This change addresses the above explicitly checking for zero vmci_trans() > at destruction time. > > Reported-by: Xiumei Mu > Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") > Signed-off-by: Paolo Abeni > --- > net/vmw_vsock/vmci_transport.c | 4 ++++ > 1 file changed, 4 insertions(+) Reviewed-by: Stefano Garzarella Thanks, Stefano