Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1581680ybg; Tue, 2 Jun 2020 14:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZyKmozOVETikrptV8SqId4DUwGUDPJoTRkO3QHBwjspnnzV0glE8j9GBTry4KF+LojYcB X-Received: by 2002:a05:6402:4d5:: with SMTP id n21mr27416983edw.49.1591131828833; Tue, 02 Jun 2020 14:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591131828; cv=none; d=google.com; s=arc-20160816; b=dmMzDhrHSyCw8odRUfsXFB/S7yYxeAQ/cMggdMjLzdKsPd+1MNDSbRSbnPQETcPeou 0qmRUJiTbMRl5xBtqXneLLvzc9lyBiQraWWvLQZp8BtKfNWhmHKPdIW0hOM6X+qieoyy wgq/q8PdPBZCLcWPHBpDlIjU149SrtG0RekQxyIoezWQudvxKOiVy73AZbuSBYB/wYSk RRUYODhE32mryFKoRtwJUwYVMWeQ0MW/IhgvetVL66bBxEatMAlgTCMtGo/38zZ3HnV7 X/o/njDVWk48ziemfZt6IB1ru0DOjefUWx4BnS7N8KIkR804+U7iTjf0xJAwQl++9N2/ QIsQ== 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=KGziKYyuOjYqLkGE4xHHPVvW1t6jVUmxReqE+2GPw/o=; b=vYyUoblSAMs5W3vnQM/lNMkp9zk/JK2nqMER0+7g7/HjywR9OliRX1rhMkZBe+OSc4 vMA8T0N9v+CZpXJnGvUAMEXFDWAPoio36kjbv3MQsc5Nje1TX8Kplm/Xi91Na//AeHqP oCstvH8oGPgZy/y+lDlhvIs3tlZSbm4vQfXh4x1yUmzmWRzEh5Cv3fJAB44FVxLIgbX4 elFh4vEDHetta+Ntf0TRK2QAGIztBXIz1sf+QpIsz0CEidC1N4Uq2dLwZxE+yFA9ytsz 55MEsDee6sejvONCJzl+yffQLv/JpO+ctZ/6DMuPd9lksV60N9z+ruuSox8zUdaO8kez 6qLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 65si2447874edj.392.2020.06.02.14.03.25; Tue, 02 Jun 2020 14:03:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727046AbgFBVBP (ORCPT + 99 others); Tue, 2 Jun 2020 17:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbgFBVBP (ORCPT ); Tue, 2 Jun 2020 17:01:15 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBD58C08C5C0; Tue, 2 Jun 2020 14:01:14 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (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 B9DB51276B16B; Tue, 2 Jun 2020 14:01:11 -0700 (PDT) Date: Tue, 02 Jun 2020 14:01:08 -0700 (PDT) Message-Id: <20200602.140108.2199333313862275860.davem@davemloft.net> To: nikolay@cumulusnetworks.com Cc: patrickeigensatz@gmail.com, dsahern@kernel.org, scan-admin@coverity.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ipv4: nexthop: Fix deadcode issue by performing a proper NULL check From: David Miller In-Reply-To: <4e6ba1a8-be3b-fd22-e0b8-485d33bb51eb@cumulusnetworks.com> References: <20200601111201.64124-1-patrick.eigensatz@gmail.com> <20200601.110654.1178868171436999333.davem@davemloft.net> <4e6ba1a8-be3b-fd22-e0b8-485d33bb51eb@cumulusnetworks.com> X-Mailer: Mew version 6.8 on Emacs 26.3 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]); Tue, 02 Jun 2020 14:01:12 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikolay Aleksandrov Date: Tue, 2 Jun 2020 10:23:09 +0300 > On 01/06/2020 21:06, David Miller wrote: >> From: patrickeigensatz@gmail.com >> Date: Mon, 1 Jun 2020 13:12:01 +0200 >> >>> From: Patrick Eigensatz >>> >>> After allocating the spare nexthop group it should be tested for kzalloc() >>> returning NULL, instead the already used nexthop group (which cannot be >>> NULL at this point) had been tested so far. >>> >>> Additionally, if kzalloc() fails, return ERR_PTR(-ENOMEM) instead of NULL. >>> >>> Coverity-id: 1463885 >>> Reported-by: Coverity >>> Signed-off-by: Patrick Eigensatz >> >> Applied, thank you. >> > > Hi Dave, > I see this patch in -net-next but it should've been in -net as I wrote in my > review[1]. This patch should go along with the recent nexthop set that fixes > a few bugs, since it could result in a null ptr deref if the spare group cannot > be allocated. > How would you like to proceed? Should it be submitted for -net as well? When I'm leading up to the merge window I just toss everything into net-next and still queue things to -stable as needed.