Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1890012ybi; Sat, 25 May 2019 11:02:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFxc4q+f4CHkEBkYPWuiOfUvYPUjSSC68NSzXK3wHw5tLd314zOhP0AajPGksp6ue0WWzZ X-Received: by 2002:a17:90a:734a:: with SMTP id j10mr17842184pjs.92.1558807376212; Sat, 25 May 2019 11:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558807376; cv=none; d=google.com; s=arc-20160816; b=SWCXB1saiKItOmtdWy4XOkPV1EOzVpHXQtbQrtd3SrA/O/P3zOE7pFiQpgYCGGacUs nVNyKNvIGX+TeXMa4+WqhTQvKavYd3MnI+0wB8XGWmEps9oAhJ6FTxspCMKl5FnAI1Od 2aOBzFtekIhpcuo4HhlLnGQvaFLkTwJ86rID9s7o1/10GAeFPvWLi8fCEJEIeJjZZcfO 74ySWo8YhPbT2RJK53vvX7gBmANeHmtlque3uk7jRMeDTwGtZh80/aCw497GRPMWRxgB mJ9DhpKS/5vmgBgx6FxUuQxyG3pnCcFgvCnAEC4V1RqeMish79BPp59bmtzzDyB8DW/w dtnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=wLuX4KqdbKIDC9GiQWN1Fqf6rn+HBIpcQvgaBVBe/RY=; b=wzmQ1Np3qXxHbV313mwKQHe+Bf29SWuSBNG/aSq/DpyZdLcmvIwz4xUZrZyHm6bhuG OwRuCBnJADPSW4JmEA+l26cIPAa+1OyZbJYTyWrPn10DSmLl2tsLCpmql2fZKwlucJG5 YmH/cCO/mJreBrRHGhuyUKSocpODpdmYBEh06E15+h9uqnqgyanzGysAqmbJ+O+eDUk9 P2tC4bHWjfDLxOQvfnvLFpIp29mlcTL49gzAVO40tZqLGrju6kwjDv4661YAjD/BiehS Ln5Nf/OyzUWeo3WKpTJP+yCbE65Lsrbm1FMPNXd1IGcJGduuUUj5DYYLV6w7Ez2BnFgG QD6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si5211475pgc.157.2019.05.25.11.02.40; Sat, 25 May 2019 11:02:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727317AbfEYSAa (ORCPT + 99 others); Sat, 25 May 2019 14:00:30 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:57478 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbfEYSAa (ORCPT ); Sat, 25 May 2019 14:00:30 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d8]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 7345712B05D2E; Sat, 25 May 2019 11:00:29 -0700 (PDT) Date: Sat, 25 May 2019 11:00:29 -0700 (PDT) Message-Id: <20190525.110029.1339691720534150701.davem@davemloft.net> To: blackgod016574@gmail.com Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ipv6_sockglue: Fix a missing-check bug in ip6_ra_control() From: David Miller In-Reply-To: <20190524031946.GA6463@zhanggen-UX430UQ> References: <20190524031946.GA6463@zhanggen-UX430UQ> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 25 May 2019 11:00:29 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gen Zhang Date: Fri, 24 May 2019 11:19:46 +0800 > In function ip6_ra_control(), the pointer new_ra is allocated a memory > space via kmalloc(). And it is used in the following codes. However, > when there is a memory allocation error, kmalloc() fails. Thus null > pointer dereference may happen. And it will cause the kernel to crash. > Therefore, we should check the return value and handle the error. > > Signed-off-by: Gen Zhang Applied.