Received: by 10.223.164.202 with SMTP id h10csp139877wrb; Tue, 14 Nov 2017 12:27:33 -0800 (PST) X-Google-Smtp-Source: AGs4zMY2oFF2zFHxBA0WZzPI93qc11+WG8OjCfpqJshkXEvCMSV0L5uQbJCWJzg/UrmIUAlZTGu/ X-Received: by 10.84.169.36 with SMTP id g33mr13786223plb.10.1510691253853; Tue, 14 Nov 2017 12:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510691253; cv=none; d=google.com; s=arc-20160816; b=EpvNqvXnL3qucman/1b+j5w/pigJ/Y6PqseH9jv4LaGY9aPRs3q7QixWqOZA7hbnkB 0kRQD4XfnUK6LiTMN5Wk/ycLUjDMHVvtoK+LWdqqbbCP+JNn8Us/AF1UPqC2H4nhwBNW MYvcxkEbp+7mlMiz0IRXtCGDd2I0A/m9xjMBN05IKmkaYBJK/7hnnnmZzTEnjUyc8b4Z 1DL0Z3ZA6PgXNF1fySc/eN6vooKf0pRXIKTDnwpGIb2AE9ewMLh0jCzLzMxqb3xXG/ON ym7P88KsZ55vIZihZRIxTDXIsJR/C94oYBhRJktWQPicvyRQNe8GT08wacJfBpVD4gvb YlIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=a82nsPyXdyyWz+OBpwEC3IrXHqljnhHXuOeLCQcNrFs=; b=EvmaMSB7UR1kVj3m0vuodWeoSseVbrl4FI+kWObwcireMFwQUY3G0Y2Jt4UJzquABs XlYevCTc73jS4zAy7vs3mXtUXbTD8GhlbWWp2pZBUwdCTZQWpP6la5+Uus875WQ2zilF +GIN4Psm10YKOjl0Z/9d3o2gFmp4iO/E8e0bQhBo7chuGPMilExyhyd3jFZzAthGidxx EKkGootDAv6UcoJ8ere6ywSQUp8dDqJu23ihqznZTh0ZiFL3UNE0UHHCVn0QsZ1hNJvC z2fpo6GtqVISlzWspnJzuQFe2wz0pmeswQuUw0JmCPxhW2JhNWVkLrHe+3zJxMyBsYMj KZYQ== 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 l81si18187033pfb.75.2017.11.14.12.27.21; Tue, 14 Nov 2017 12:27:33 -0800 (PST) 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 S1756359AbdKNU01 (ORCPT + 88 others); Tue, 14 Nov 2017 15:26:27 -0500 Received: from gateway32.websitewelcome.com ([192.185.145.115]:31897 "EHLO gateway32.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbdKNU0T (ORCPT ); Tue, 14 Nov 2017 15:26:19 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 13BFE55FC for ; Tue, 14 Nov 2017 14:26:19 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id EhmleYFSDrWstEhmleFVpR; Tue, 14 Nov 2017 14:26:19 -0600 Received: from [189.175.248.21] (port=47120 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1eEhmk-004Coi-DQ; Tue, 14 Nov 2017 14:26:18 -0600 Date: Tue, 14 Nov 2017 14:26:16 -0600 From: "Gustavo A. R. Silva" To: Pravin Shelar , "David S. Miller" Cc: netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] openvswitch: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start Message-ID: <20171114202616.GA10862@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.248.21 X-Source-L: No X-Exim-ID: 1eEhmk-004Coi-DQ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.175.248.21]:47120 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It seems that the intention of the code is to null check the value returned by function genlmsg_put. But the current code is null checking the address of the pointer that holds the value returned by genlmsg_put. Fix this by properly null checking the value returned by function genlmsg_put in order to avoid a pontential null pointer dereference. Addresses-Coverity-ID: 1461561 ("Dereference before null check") Addresses-Coverity-ID: 1461562 ("Dereference null return value") Fixes: 96fbc13d7e77 ("openvswitch: Add meter infrastructure") Signed-off-by: Gustavo A. R. Silva --- net/openvswitch/meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index 2a5ba35..bc0b6fc 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c @@ -106,7 +106,7 @@ ovs_meter_cmd_reply_start(struct genl_info *info, u8 cmd, *ovs_reply_header = genlmsg_put(skb, info->snd_portid, info->snd_seq, &dp_meter_genl_family, 0, cmd); - if (!ovs_reply_header) { + if (!*ovs_reply_header) { nlmsg_free(skb); return ERR_PTR(-EMSGSIZE); } -- 2.7.4 From 1584123498892066477@xxx Wed Nov 15 09:24:54 +0000 2017 X-GM-THRID: 1584123498892066477 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread