Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6340612yba; Wed, 1 May 2019 10:18:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxG8mR7yhMNcYFnzuD4igmVNWHZAMPcsU22YhK+MRIgKHChXXKaIO0OlsKfS5/qvzVpYzPN X-Received: by 2002:a65:60c9:: with SMTP id r9mr29004510pgv.319.1556731113195; Wed, 01 May 2019 10:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556731113; cv=none; d=google.com; s=arc-20160816; b=LYVSbW8R78o88qd0nyHMwZozQnSQAlZ22jK62gClbNvhqeYVTOr1f7Cdocnc4OU8VA Ub8UsuExUHnPcNyvVSn3F+G9YQWi2Gr/jGWflHDaaxpfw6x84E0CDUWQe5kQQpDRkhQk V3AJhlphnKoIQ6zGQVeVNWdPMXIzkyMIzfhmG7yriDN3r4bwm0v9LBLgWCEmZaxfcG+f 2slC6oDhFj5dvBVS3BQZ/Ca/sGbPDtwlkLOoOXEA0ePDm03riKfIzkvJyc5L1dnLJ0WV HCz7+xhTPUw+k7todwuzq0pP6WB9xqN9n28bI5eRIW2DaBkP7AKJB8q/di5/sCYgHU5M 0Ilg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tb3e5ndhy+yPYfLxxwqvS+VC2wvQfTcibV/Zpc10t8Q=; b=LA4ikT2uGHUt06mY2oxiJh3tEujy3EvtkGqv7kI+JU2XYO+hJFQxx8OtZRfiPNchLq ekNxHRDlCCN7+nkRAz5aWmFkguNf7iYhFc32TqcaG58Uq0z4O2uBXOvTSdTj7vTlwoz1 uMCORpvL8fsBRXLhUmBVJgVYifhVymQlnh6UJA6s2924qU1AZaDgteNlaFrDHZ3KUoMj +nUW5IcVQaysS1ZivRDE1vI/xmi3MLk3UGGR+14n9hfYHPzfgeSIpb3qs+7lFLB4igE1 +QSkem3XSq/IRBjp7zFICwmIDJ4DCxTwkCfSeaNfczMEIFJoKTDYWrS9/QRvp1fQJhrm +p4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M6re7Uiw; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si239845plf.2.2019.05.01.10.18.18; Wed, 01 May 2019 10:18:33 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M6re7Uiw; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726186AbfEARR2 (ORCPT + 99 others); Wed, 1 May 2019 13:17:28 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33779 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfEARR2 (ORCPT ); Wed, 1 May 2019 13:17:28 -0400 Received: by mail-lj1-f193.google.com with SMTP id f23so16061322ljc.0; Wed, 01 May 2019 10:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tb3e5ndhy+yPYfLxxwqvS+VC2wvQfTcibV/Zpc10t8Q=; b=M6re7UiwzFF81SnvukKzpOhzXOVMusmPCGgYLA0vFDmgKc+WjzPpsG9q2me+FOZrUK 55erpX71KWunJAh5MXpnVoW4KxPWQGbCyN5+w1hn40qIVvC5eB43ErBvrZ6wZok/vbW2 uqt5PrFvhVhjXPAmxCQqhXHwTxNHbeFIBlBN6yIYd+u28S3DVPnVgxnvssnM6Hq6zdeO RlOFuVTYCwZ35nTLZaW4TNexXJgIIVNq0xkMrH4KJ4TKgkGUCPcvIZK+ij5J5Azffzi3 ByDC3sOmKjns6h5AyldOQrlX5a3jBmNHO8jLwJede/8NuAZBXQfyC5Vye7LxkT5YPkaZ cZvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tb3e5ndhy+yPYfLxxwqvS+VC2wvQfTcibV/Zpc10t8Q=; b=PBhR8+om3Eq+SQowSnWesTVw2lF1PskkC/ix665qCLtgBlJ8n/+WMbRg6ULRMqd9mW frUmJXOFpV4mY1uSMA682UxCidiJ2ixW6T4fn/YjPYpG8hya09THndZflnfZvykxaNBk yGnjXS9XOba8MSL5Sv8ax1PNGHnmDaQDlk5OkXZxtWaAq/7kSL/ILh6uzNP8+vnH2Y1h rfr46GvhqMF0EZqQnuu9iii3WqbWSyyzyV4rjO68f915rOUydOJtMX0mPX9GD1iBDmv8 6OiZy3DWae0uwM8L+zaxF6SJL3IZv1MOoiVZPfV9sv9fERClIqehVQYAS1ZNVNNfovF3 aVFQ== X-Gm-Message-State: APjAAAUtcasoZ1R46zI3ky3SExtCRTzFEwv1GoUZqzuqOAVun4bFxFJ/ bk1kVyUEACNtZCFntyFXcIn1ZZjF/MD6E/5UrKc= X-Received: by 2002:a2e:92ce:: with SMTP id k14mr16778740ljh.83.1556731045705; Wed, 01 May 2019 10:17:25 -0700 (PDT) MIME-Version: 1.0 References: <20190501134158.15307-1-colin.king@canonical.com> In-Reply-To: <20190501134158.15307-1-colin.king@canonical.com> From: Yi-Hung Wei Date: Wed, 1 May 2019 10:17:15 -0700 Message-ID: Subject: Re: [ovs-dev] [PATCH][next] openvswitch: check for null pointer return from nla_nest_start_noflag To: Colin King Cc: Pravin B Shelar , "David S . Miller" , Linux Kernel Network Developers , ovs dev , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 1, 2019 at 6:42 AM Colin King wrote: > > From: Colin Ian King > > The call to nla_nest_start_noflag can return null in the unlikely > event that nla_put returns -EMSGSIZE. Check for this condition to > avoid a null pointer dereference on pointer nla_reply. > > Addresses-Coverity: ("Dereference null return value") > Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit") > Signed-off-by: Colin Ian King > --- > net/openvswitch/conntrack.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c > index c4128082f88b..333ec5f298fe 100644 > --- a/net/openvswitch/conntrack.c > +++ b/net/openvswitch/conntrack.c > @@ -2175,6 +2175,10 @@ static int ovs_ct_limit_cmd_get(struct sk_buff *skb, struct genl_info *info) > return PTR_ERR(reply); > > nla_reply = nla_nest_start_noflag(reply, OVS_CT_LIMIT_ATTR_ZONE_LIMIT); > + if (!nla_reply) { > + err = -EMSGSIZE; > + goto exit_err; > + } > > if (a[OVS_CT_LIMIT_ATTR_ZONE_LIMIT]) { > err = ovs_ct_limit_get_zone_limit( > -- Thanks for the bug fix. Should it be on net rather than net-next? Acked-by: Yi-Hung Wei