From patchwork Sat Oct 28 17:31:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831627 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OPWjB3gK"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSWH2RGMz9rxj for ; Sun, 29 Oct 2017 04:32:59 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0DBEF93C; Sat, 28 Oct 2017 17:32:19 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8EF382C for ; Sat, 28 Oct 2017 17:32:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8522646F for ; Sat, 28 Oct 2017 17:32:16 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id g6so7748371pgn.6 for ; Sat, 28 Oct 2017 10:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=JyxHRI48mmmHZ9PMsr9EixHkCEI4cUjtumUd8Zkinkw=; b=OPWjB3gKMsyalPwn+LOgEcMOT/69cgrVLMrcBsefg68iNtkvefx/p016o8O3TDit9g v6nyH4J02/jY25mGrgzjl3xJ0V3XimPbD55dv8dl/a1ipfeDy8KAk3HJ+brARCuOC82H Xgy/pH1gd9Y85qAU82VwpFyG9GvvZxKqOeApGWoOCSwLQywXviEDMwYjX4xBd1XxtOSU zIr5VuokmVI6iXYc/kBstBA89tc9AYsrvdHsWD0xic8dxENHlhfgAIqZizOPCvMj18vt f2A7tZVud8N33GReLYZQl6hl5PGqvl00kYzON6o2EFnAK14xndiQmtsHSAXV6UqiKvJc OcZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=JyxHRI48mmmHZ9PMsr9EixHkCEI4cUjtumUd8Zkinkw=; b=s7ETzizBtPNETOf4AqlTlS4gFfFjaaGp3konQduyvrTbVDqdAUwI0s8wkT2NdZH3Cf 60QspCF6VcIxWpZ3301iwYX1l4+W1l2EzlJU1fYp3EW+rA1CjkiCp0mRs6fOptzlBXw4 yTIH7zwNRdx1XwhCqJdnlHCR2cr40pYTCZa0PG+QJrQwtsejlxWbbDOiIrHnDRflaTjL /YIVnXwYBKgwxk5tHj+Dmjyr10vtFqwlPwkRzfronAUHTAHg/XCcK6YFSuUJiwCQ0RMw ZRuVLNV+YIPAI4LH2TxEPeaAMfK/PmI+2ekf2IAfaamPBrAKtm9Eznx6hHe6+rSyQOeq nhtg== X-Gm-Message-State: AMCzsaVfT+VnWpE5Yk/9k2Mh4rfoSzFAdl16ehSi669GPHX8899eDhjJ O9+vkqCqxjcDrxqJSlE7fjPQkAUV X-Google-Smtp-Source: ABhQp+QYyfX5f7Wod+rMsSciYYbM1V3Z6/X4Phaytr2plMhQsT33SiStu25CUiLsVTipy84d5seSVg== X-Received: by 10.159.195.7 with SMTP id bd7mr3353665plb.366.1509211935935; Sat, 28 Oct 2017 10:32:15 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:15 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:48 -0700 Message-Id: <1509211918-14829-2-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 01/11] dp-packet: fix possible null pointer argument X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer argument to the memcpy src. This is due to at dp_packet_clone_data_with_headroom, the dp_packet *b might have a NULL base due to allocating a dp_packet with size = 0. Fix it by adding ovs_assert to satisfy clang. Signed-off-by: William Tu --- lib/dp-packet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 443c22504379..f48e195a51d2 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -222,6 +222,7 @@ dp_packet_copy__(struct dp_packet *b, uint8_t *new_base, size_t copy_headroom = MIN(old_headroom, new_headroom); size_t copy_tailroom = MIN(old_tailroom, new_tailroom); + ovs_assert(old_base); memcpy(&new_base[new_headroom - copy_headroom], &old_base[old_headroom - copy_headroom], copy_headroom + dp_packet_size(b) + copy_tailroom); From patchwork Sat Oct 28 17:31:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831628 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DAXCvgE0"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSWy0JWsz9rxj for ; Sun, 29 Oct 2017 04:33:34 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2A66B949; Sat, 28 Oct 2017 17:32:20 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id AF97A2C for ; Sat, 28 Oct 2017 17:32:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6E48E271 for ; Sat, 28 Oct 2017 17:32:17 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id z11so7318091pfk.4 for ; Sat, 28 Oct 2017 10:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=KMwIhTooIppzOshewQuWABEzLWhz089NoeYHHd62lEg=; b=DAXCvgE0R2FzaktJPaAt0a8HQRwPlmt9/qRjCFjTz6BVV3mWjd/NIzA2U6GEKj3cyt an4rm2R4XNpzYZQq5DlNgY7YfCguoMk9U+MyO3ktHq7UQjb6c2SyosqYpVTA3zgtmzo3 K41q6fQpcrwdYRyQJbzKJva/OppOl+tjS8nHdh579YwkBoQtZhA7Il1R/vt0tKHi8k60 Hbcp6+3iGsDQwUVBFsNu1ImEBUHx6WfC7/LL6iZwB/BLED6oX+bqbBP2Oqpd0Wmppj1W 1RGM3s4K5Z4+VLhm65g45f3P3XamBiudALQ3qRUu/ocF2n4BvvYNbP4JJehI1E4swqtX 1MzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KMwIhTooIppzOshewQuWABEzLWhz089NoeYHHd62lEg=; b=dW3uvum1cT6uaqG3evcdiuqjooRjRc8hJN9zt/uLJSIMVW6CwO80h6Be/CJeE6ZsI0 EOT1DeynaoQi0O5MkPeMnaERHzffppQYkJKPBEfu1iSSW544QwQDY6x65T1gaRchsL6y ZHIfrAmmVpgmJJLKGqHZ15Blobz36kJj+u1ztDSjBMSuWkYV2OCEviIytiPePkC5N4is YpOfID94SxItMOzwIjEq5knBlnfw+bHx70pIibHfXrm8p/WHfxpnGOXWAX6u849sZLrp 00RP+6HLW4W464B/QUKkFr+kf8Ng6uXpYsmaTdsvywV1mgFL2oh09GXMpFo7sAHvb+Um 3kDA== X-Gm-Message-State: AMCzsaXDb5/RnqeY4ZwMAI1hLZGb0LXbe4D9zOFY/fXwgWYnmtQ8EDOQ GtRp9XnqUrTtVVE+EV5yRfMj4Sdf X-Google-Smtp-Source: ABhQp+TCTCcVMOpo4O7GFbP/ZR8SDW/ZNOcGVsZOnJxY+isIEbLXOAI4u4vJzCzC1HvDWTuwIfuvmQ== X-Received: by 10.84.132.66 with SMTP id 60mr3222754ple.225.1509211936893; Sat, 28 Oct 2017 10:32:16 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:16 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:49 -0700 Message-Id: <1509211918-14829-3-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 02/11] ovn-controller: Fix possible null pointer in memcmp. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer in_dhcp_opt passing to memcmp. This might due to dp_packet_get_udp_payload retuning null. Fix it by adding ovs_assert. Signed-off-by: William Tu Acked-by: Mark Michelson --- ovn/controller/pinctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index 469a35586b8a..3fdd01182a52 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -270,6 +270,7 @@ pinctrl_handle_put_dhcp_opts( sizeof (struct dhcp_header); ovs_be32 magic_cookie = htonl(DHCP_MAGIC_COOKIE); + ovs_assert(in_dhcp_opt); if (memcmp(in_dhcp_opt, &magic_cookie, sizeof(ovs_be32))) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_WARN_RL(&rl, "DHCP magic cookie not present in the DHCP packet"); From patchwork Sat Oct 28 17:31:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831629 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gh42Zbai"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSXc4PhZz9rxj for ; Sun, 29 Oct 2017 04:34:08 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3563B978; Sat, 28 Oct 2017 17:32:22 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id ACFC8918 for ; Sat, 28 Oct 2017 17:32:18 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 622C6271 for ; Sat, 28 Oct 2017 17:32:18 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id s2so7738095pge.10 for ; Sat, 28 Oct 2017 10:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=syzHriuoHqy0IaCZlKGAci/4DlLUDKJuYwQ0hjWVErA=; b=gh42ZbaizNJlRzFG/pRwzmKxiUVpVHlf2ukYbSdcwngxv9b7sIKgBVwwknSZCZGsxQ DRLl3jdSjd7GWVjA2yKAtB1yXmn5pnfY4d9e4kliX26nmEqMuVz8z7FEAEL3RVVWfdZr u1au6gbwiUdddlax+CNMQJh5ZQNy/5yiSHjvmHnGqHK7yD++BklMadj0VFUkn7tMBDmE YI3hANz9wQo52Lx973qgkBS2wCdgms5DSrr2+dQGJCF5AD90wmgkrMVtonlqr4DrjFq/ KeK+3YZCRTSDkU2gWoxigPcQLDWK2IgPdp5C3/uzYpre67m9b8L+VDYJXU/ep3JozlQk C1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=syzHriuoHqy0IaCZlKGAci/4DlLUDKJuYwQ0hjWVErA=; b=Ti/MVjCrjGavGZQAbFbcA+wIsFARWBISKspfTTDlvXmFYmB5b+5MyzExwIBR0gXsTj tEJYcfyc7OO4GKmZmuySGScBtAKI28ECVj1mUsaSQ676Ah9QNpgFEHRgYFXMITvqZrot TZ/P7vrVfixfxDdtZigOm5xWZ593y9j4Q5vuD8MsFCHjZ0jccZvdGqMWISsmhKw1Eu3O cIU0nzF90xttI5FLVZPXteeeJWE7nvj/TKgWIELA3iGImZsP27JBijaqFU4Jg71/vdiI Zo0uTG2UCifu9uR1xpKSP7s15HHVFSoy8wEAikdQOcDoja7Bnyy4drt+PfJa1dgkJttA Jcjg== X-Gm-Message-State: AMCzsaWM4YAvVVhH8K+mfI5T0VC3l3XFkDetb1ePcHXKaQvREFa+hEBi RSeZYavOC5SfwXZUZlzgXIPxrub7 X-Google-Smtp-Source: ABhQp+S06bSUuUIHvEPq3ixpPGNJq0BvSfySgY+zeD2lE7QP+Cy18GJKbvak7Uo95cEae+kUUK50aA== X-Received: by 10.84.235.201 with SMTP id m9mr3223705plt.94.1509211937862; Sat, 28 Oct 2017 10:32:17 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:17 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:50 -0700 Message-Id: <1509211918-14829-4-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 03/11] ovs-appctl: Fix possible null pointer argument. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible optarg as null pointer passed to atoi. Fix it by adding ovs_assert check before. Signed-off-by: William Tu Acked-by: Mark Michelson --- utilities/ovs-appctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ovs-appctl.c b/utilities/ovs-appctl.c index 8f87cc4f6c6e..cc1326bc9478 100644 --- a/utilities/ovs-appctl.c +++ b/utilities/ovs-appctl.c @@ -165,6 +165,7 @@ parse_command_line(int argc, char *argv[]) exit(EXIT_SUCCESS); case 'T': + ovs_assert(optarg); time_alarm(atoi(optarg)); break; From patchwork Sat Oct 28 17:31:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mNGfDy12"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSY949dZz9rxj for ; Sun, 29 Oct 2017 04:34:37 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 188ABA70; Sat, 28 Oct 2017 17:32:23 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 91D8B949 for ; Sat, 28 Oct 2017 17:32:19 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 59331203 for ; Sat, 28 Oct 2017 17:32:19 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id e64so7307803pfk.9 for ; Sat, 28 Oct 2017 10:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=u/uw1sn1qy1VATkMSKm7TJS539x3ZAl4ZQrgoiWXkOU=; b=mNGfDy12CvPmBXawIupFKHI5MgFbcWrYRtU1sASJA79Z2pth4mjqexpbZB4afv1kvD xebshy1H5VgaQB1l7QWG0kGR4VJpQGNABh7W1AIsLUmTrLzkj0RmoLxmPcLdGbuUpXG4 nGoNTdSi8LKpCQsVbC/BLA0KN08LldhscjphIXTNgWaGwDkG8aNdPLLVV/ts+PQ7GjUA WCgNvW2smL4s38REW5AuFg/TcQg9suJS3a42WkfLqQnPNQK0zn2QDT7whAvbDC6r4osz NtZrh4w2vIp/UIQVON9VH6RkxmcZJWJgaf+5YFxo12bS9+Qi50Paqa9ZWNoRqJ+TEhcp W2Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=u/uw1sn1qy1VATkMSKm7TJS539x3ZAl4ZQrgoiWXkOU=; b=S9kRNGArKXc6nrjD9JT4n1mdzZ/aym2uacFQk83qjeiPMQFCOfxL41uPEonn+p6KRH gAO1JXXUKirZfJfCvafHKIUW1evlyAKaOU1AytWyvVbcq/RpgNoWnwNL6F7omMENdrCI flRpP24EfTz9ClSDibEC3uVPA/mAByqL7Qi5GxW/EbeAixwWbigiA/DgsLkhFJhG2EXf jsWIt+h8pNS2vyE2uNUdP0m8tntWCu121vOdph6xHn6hSTU+jKQCKYmq4JIEttgIzcyX tJLE9WCuI3NPwSEZxZt//MXe16LZUGx8nG7CCD7/PFbdf/Anw5Ez5XHylygONIM/W62e GVlQ== X-Gm-Message-State: AMCzsaWjS0VmtuumGY3D0RGw3WHf4RQIXBy7h0bfmWjBeAN6FWvj3udI 6KM6g0ew91W73WHB3gj+PP+xLx9I X-Google-Smtp-Source: ABhQp+SjQ8Na6f5POTRQFaFyQgYDzpPJEEKyMdmy6/h/2qT8o0PtyGtxFcGVM+7w1eZQqQ4nOtGwCg== X-Received: by 10.99.99.65 with SMTP id x62mr3456803pgb.221.1509211938717; Sat, 28 Oct 2017 10:32:18 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:18 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:51 -0700 Message-Id: <1509211918-14829-5-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 04/11] lib/process: Fix possible null pointer argument. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer due to process_register could take the name from argv[0]. Fix it by adding ovs_assert check. Signed-off-by: William Tu Acked-by: Mark Michelson --- lib/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/process.c b/lib/process.c index 3e119b59bfbc..254052f2c27d 100644 --- a/lib/process.c +++ b/lib/process.c @@ -172,6 +172,7 @@ process_register(const char *name, pid_t pid) struct process *p; const char *slash; + ovs_assert(name); p = xzalloc(sizeof *p); p->pid = pid; slash = strrchr(name, '/'); From patchwork Sat Oct 28 17:31:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vC5VrvhS"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSYj3zy5z9rxj for ; Sun, 29 Oct 2017 04:35:05 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2E138A7C; Sat, 28 Oct 2017 17:32:24 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id B13415AA for ; Sat, 28 Oct 2017 17:32:20 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 73064203 for ; Sat, 28 Oct 2017 17:32:20 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id z11so7318148pfk.4 for ; Sat, 28 Oct 2017 10:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=+7TjbBo8D2tSDc3F5N+mtNO2EntIZkXqqObvE0YYE9s=; b=vC5VrvhS0ljkVXzGt4dh+uC5r5QJRfYjoJeUn2fppWtvR5laQOe+bf7J8rIZBEncnX yar5g46dYBnKnnhnsiQPaAErDwzAfqTrolN3hK6Tzivj6JL7xskJMS0lR3+dXtNWOrnc yv4Tt6ca5+vWmFYgROxPuxTqCoh221ihDt2Zm10He9pi6GiunW897XYNbzVANfPTyq2A 9Lp0vucdAepN0NiaS8i52cNXFPcasc9ceILBpDiO4Wp0H5xwH91RARTffkXaeWS/KCaN sqVdkxzu/JXITQyR+qLr1BMZc50YkCrEPXX1QisUA29KW/yOZn/yUI0p13/zCsU3NMMB NEUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+7TjbBo8D2tSDc3F5N+mtNO2EntIZkXqqObvE0YYE9s=; b=am4BB4XRSxP3VxUh3XaPh72LoVafy2xkJbta17RbgjVgGL0TkRVi+B/aZ9XOBe6USD 91JD+JwqOc78Xo5Nw6Yf93agdqPqJylQ/fFsEkQihq54pmfTC+TfKqPt0OskNmZLtTYa sCXM/omaW9E3xx2hIqQq2wPVTf/hDDc6bOhF2W6TWozGzqAdTgwgQz4jIGXxVZb9PKky LL/rEHcIqhmUrOPFHrx2iMx009x7ZVNTFUiI/BUI6tNOSI7XTCA2miU6Uu+66npZRtZe hkhaa2OFr9zAKbVQwEFqm5YlgQwQgGHnNLxhJTLuJqoMuD+7vfM6vfg7v5UrocOdBr/n qF2g== X-Gm-Message-State: AMCzsaUfVMko7kLYIyZq5dOfuxtTJj3M7NnwC3Cl0yCo/i7u63hXtdhp vK67+WzL4DG9euZMGcFuFA08ajAH X-Google-Smtp-Source: ABhQp+Rq92IHBZjOj3Ng/SrPcS7+IJ6x6man44NeYQtxPOZfsbsRox4XdIzOAqj7ehBNLVG6mYgGCw== X-Received: by 10.99.119.79 with SMTP id s76mr3435947pgc.3.1509211939875; Sat, 28 Oct 2017 10:32:19 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:19 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:52 -0700 Message-Id: <1509211918-14829-6-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 05/11] ovs-ofctl: Fix possible null pointer. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer of optarg as argument to strtoul. Fix it by adding ovs_assert check. Signed-off-by: William Tu Acked-by: Mark Michelson --- utilities/ovs-ofctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 5b7f1b02104f..05c5995fa775 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -262,6 +262,7 @@ parse_options(int argc, char *argv[]) switch (c) { case 't': + ovs_assert(optarg); timeout = strtoul(optarg, NULL, 10); if (timeout <= 0) { ovs_fatal(0, "value %s on -t or --timeout is not at least 1", From patchwork Sat Oct 28 17:31:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Om81Wktv"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSZH0fJXz9t42 for ; Sun, 29 Oct 2017 04:35:34 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 285B69AF; Sat, 28 Oct 2017 17:32:25 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 744E45AA for ; Sat, 28 Oct 2017 17:32:21 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4758F203 for ; Sat, 28 Oct 2017 17:32:21 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id j3so7766150pga.1 for ; Sat, 28 Oct 2017 10:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=RD6z9KiYHy/6VazMJtSENurGi55NKxVhyQvZmVo1eig=; b=Om81WktvIqbsNPm8H+zYperp0J+ZW2pWCjzOfsFY/bZYb5DQyZ+x2pi0GHbNbwMDZY M/24OMlRksqVvKU5h60UTCGOJjorSx+Df+feTv/ALXPz/QLfD/LEwnqxG6filvCKVF/w Jj7aJMBNrcBZyh+eiJPA/Vf4uB96JkJn43XhW54H5xRRPBOfwEPwxaCoRfpJZ+bfG20O 2ZpCOTgnULK4JKBB4OVtOZM9i/6ERObhu2fBi6CmcVBz3Gg89O7GkzoCleXvY0/hDJU2 3ZAaTXH1J9HNQmrgLy2vdBwl5PnKlid8ulQ/WIibbCnzSyU7yCzui4eOQ1FklxEJ3t/x k09g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=RD6z9KiYHy/6VazMJtSENurGi55NKxVhyQvZmVo1eig=; b=OzQ3Og5dqBgMA055S9gUIHa+4U1/hImhtf0ooa0x2waRB+P9elNqAOV3XzbQZeTR7l OVmNkuFRGZD3+fdWMDJnhdb0R/R5aXvHC+Q/dpjgLiYd/uqJBGLRSzRZWaZDYZlGdWTq 3JxqXrqGzf2skqso6fVTynf7BJfvsMos8SZtX8LdijHvs3gJu4htldAr5pSTlTW01y45 wWAKMpRR53Lb3KHa0fapnZcQncf48u41iz8Z22Fzk5e7CbxHgp+oYpxiWlZN0U+73UZu dd5Asfu2/P0H+D2GGYw/EGah5rRDEwWKEI+GicpxZWxL2YWDlDkswktSxQloOasIgM1m 61dQ== X-Gm-Message-State: AMCzsaXXf1SyNiw5EuxAFrX1M61SMKChPJW0FNh8J6Htw1exg72BH+nU z0Dl+YwMdXz/02UU6E0vpfi5FaDn X-Google-Smtp-Source: ABhQp+RWBokxt3VyROwEIkgz35LgH9kwO5reLe0nEPP76+OZxODxXA7RNRsRjjdIZ4TGT/sfE2GLvg== X-Received: by 10.101.77.144 with SMTP id p16mr3447766pgq.226.1509211940748; Sat, 28 Oct 2017 10:32:20 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:20 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:53 -0700 Message-Id: <1509211918-14829-7-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 06/11] packets: Fix possible null pointer argument to memmove. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer to memmove due to dp_packet_data might retun null. Fix it by adding ovs_assert check. Signed-off-by: William Tu --- lib/packets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/packets.c b/lib/packets.c index 74d87eda89e1..230a62553ff6 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -397,6 +397,7 @@ pop_mpls(struct dp_packet *packet, ovs_be16 ethtype) dp_packet_set_l2_5(packet, NULL); } /* Shift the l2 header forward. */ + ovs_assert(dp_packet_data(packet)); memmove((char*)dp_packet_data(packet) + MPLS_HLEN, dp_packet_data(packet), len); dp_packet_resize_l2_5(packet, -MPLS_HLEN); } From patchwork Sat Oct 28 17:31:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lcA1Hztc"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSb30SPMz9t3r for ; Sun, 29 Oct 2017 04:36:15 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 72390AB7; Sat, 28 Oct 2017 17:32:27 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A0E0A9F0 for ; Sat, 28 Oct 2017 17:32:22 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 676ED203 for ; Sat, 28 Oct 2017 17:32:22 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id b192so7757283pga.2 for ; Sat, 28 Oct 2017 10:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=/2/GYPwICHihOIoAerxw4ERT2+w5O+tSia7zM4kOrJw=; b=lcA1HztcZRfp0+Mbxty5iPDtz/JzcL1QgZXZDUCmN4OP3uirzbseLCP1L3ZmR9oN0K YcvhiRcu0q0AeQSPa9Ig//cgfeGnmmjR4VuKOaLWM/E3IPEt5jqR29ploryrpU5J9uU+ Ix6FM9LtKRGyKC7nIzue2iExv+xUf2U3EbPT40zTxrKXv5lDMgl3e5HCJ9XjH/5nmamq mFTwAynHVY03460iTTnJJ0Koq95izwb6PnKC1ms/+zlnZL1gsCFb5orPaYZO4tYSc3nx lWgzq2DtEYd+nvTk1JUeU55k1KGo4E+4Oh1xY0kL0X62qI3OlVQ4qmoJYfRNmjr8jeTA TinA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/2/GYPwICHihOIoAerxw4ERT2+w5O+tSia7zM4kOrJw=; b=O7skhV9lEiOkeiC9OWjt/KKW4HQHUtaTq7IIaXd58mTidLxhPwBtGtxdXeuz7vkL7j mjJKtJKZ68ZQVjhnMG3MqweIGoeDy/p57XiTtD117vCfyklkkw4ihC7rADipqJKM1urS uxnd6NNvGqiZKAji4/lD5L7cNp0H6X5HrrcfPM6VIb0jZB3QTSujzHxYnGx23JEg+3o8 cTXF4T4B5/h7bW4yakgKK7uHJBPx4o57Z3JAB52WjZUPKE0oaT5IOeKW3tc/s0BWPKWV WO6zbckNDsre14HrKT53G1PiYTa6MFPqAHGuA4Jn069T00Cy/ZmXbh1QBo/2jVPOJ5rR BR5Q== X-Gm-Message-State: AMCzsaXIXlsx87XVrDMxQ9QZ4ygwkEd6unyd90DE7PggmhKiGWdrKyaz yav7OZsyWorZC3hsJG7gmuGahGtm X-Google-Smtp-Source: ABhQp+SCJqLl+L+06yUdadS+Kn62wBGZ0Nb28K0pclhAio/tuquTvQ16Vb3zLg3s0ikQ1G11nESP0A== X-Received: by 10.99.152.68 with SMTP id l4mr3430451pgo.443.1509211941802; Sat, 28 Oct 2017 10:32:21 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:21 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:54 -0700 Message-Id: <1509211918-14829-8-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 07/11] packets: Fix possible null pointer to memcmp. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer passes to dst of memcmp, &nh->ip6_src. This is due to *nh comes from dp_packet_l3, and dp_packet_l3 might return NULL. Fix it by adding ovs_assert check. Signed-off-by: William Tu --- lib/packets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/packets.c b/lib/packets.c index 230a62553ff6..7b147bbfb880 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -1191,6 +1191,7 @@ packet_set_ipv6(struct dp_packet *packet, const struct in6_addr *src, rh_present = packet_rh_present(packet, &proto); + ovs_assert(&nh->ip6_src); if (memcmp(&nh->ip6_src, src, sizeof(ovs_be32[4]))) { packet_set_ipv6_addr(packet, proto, nh->ip6_src.be32, src, true); } From patchwork Sat Oct 28 17:31:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iy/Y1yES"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSbc62lwz9t0F for ; Sun, 29 Oct 2017 04:36:44 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7BF2DA67; Sat, 28 Oct 2017 17:32:28 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 94FD7A74 for ; Sat, 28 Oct 2017 17:32:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5A8D7203 for ; Sat, 28 Oct 2017 17:32:23 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id d28so7316081pfe.2 for ; Sat, 28 Oct 2017 10:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=B5SZxO9rWrabKJ/RRx1R3ggCaaHYaCMqrPhKuQfmsKw=; b=iy/Y1yESa7vGMToBCjwi2RI7bA+NXYEtFC0l+g2Gczj3ghBa3VZbXqJXV/BTSYim9K A557dFuI1bnlZ3opvXwwm5tVqMLFaabJwXrwtUS5hdc2KCR4THOz4O9KWSfZatBWwdDy TibpvP8yTfKYGW9pQq2UnljfhPhCMd8GWlvkOMTducqfV4lBZ6iHSRUg+kKw0FB7gO0c iLf1wYrD0ZkeYSK78lCTBRD0CmITnPjIkTTZmITFwBVtRMuNkxRSuWd+HiC1acbLL2Tz RdbnzOe6K2p7gclkUKV9vdMbTAjbPx0+LxWE0IPrCR7jeyFNkW+hEfaiy32Pw+n7dtqm pjhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=B5SZxO9rWrabKJ/RRx1R3ggCaaHYaCMqrPhKuQfmsKw=; b=X0fuDeOpyIYm7r8qWs4OeObtw9DOOu2/BQHR0pao7wVxtoRm6NGdtU2Dg2DotiOMdD i5Wu5i7wn/Zv3t+tXqTHdFnnwr/uDLEXzJyUaDF9TVUavABIxbSHh3KR95jYQ17skD40 VuTnYwHQyb6XSUjzm6y9nj2jfVs61gzhoQ4mKf0Ks+iN2qFW0Ay5+h9omjAN6DLNh2H6 hanEwyX6/tilw2amuK5arbcCVunurvlgujdGjw+yl0UwPW2oqLm4MB/tCEQ2nK5IxDVl 6W3sEGXlHdAjHZ9eLy+Xpn2CGR6R7bz4kTiySeJRMrcZi0PDdsXBwg+vR3RuM0Kyu0SQ jWIQ== X-Gm-Message-State: AMCzsaUStVuE+GHeF8dOwR32Izp6G4aEHmdhDZDlsOYGfXBQYIPc4/60 FuapGGXgm0iOaqBnC7XDyjXRAdng X-Google-Smtp-Source: ABhQp+SvvMowLnCS+mwJJJp3eGNOWHzlLXpHSqZwKFBNWwliDYLrpPrj+ds11hL04YbQI2E9pZPp9A== X-Received: by 10.99.44.208 with SMTP id s199mr3465873pgs.80.1509211942808; Sat, 28 Oct 2017 10:32:22 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:22 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:55 -0700 Message-Id: <1509211918-14829-9-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 08/11] ovn-sbctl: Fix possible null pointer to qsort. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer 'lflows' passed to qsort. This is due to the checker unable to make sure whether 'lflows' gets malloc or not in the previous loop. Thus, fix it by adding ovs_assert to pass clang checker. Signed-off-by: William Tu --- ovn/utilities/ovn-sbctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ovn/utilities/ovn-sbctl.c b/ovn/utilities/ovn-sbctl.c index 7af5863b08fc..b1f106002842 100644 --- a/ovn/utilities/ovn-sbctl.c +++ b/ovn/utilities/ovn-sbctl.c @@ -860,6 +860,7 @@ cmd_lflow_list(struct ctl_context *ctx) lflows[n_flows] = lflow; n_flows++; } + ovs_assert(lflows); qsort(lflows, n_flows, sizeof *lflows, lflow_cmp); bool print_uuid = shash_find(&ctx->options, "--uuid") != NULL; From patchwork Sat Oct 28 17:31:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BcJgMszY"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPScD3YZBz9t0F for ; Sun, 29 Oct 2017 04:37:16 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 715E5AC9; Sat, 28 Oct 2017 17:32:29 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 82895A7F for ; Sat, 28 Oct 2017 17:32:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5D076203 for ; Sat, 28 Oct 2017 17:32:24 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id s2so7738262pge.10 for ; Sat, 28 Oct 2017 10:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=+vGukS6+Y2S5WypwpEDTAWeIMK1P7++z4QUGaRFK+Y8=; b=BcJgMszYuxABd0JftLrYMciyDcJNC0ryprX25TUENRfJkqe7TnbJiNO6Mm4fB6tIrG azDBiBWNjpf20wNvxzu7NNeVVLSsJuOMxdq4TR9cno6QkCp9ytn7RrqERsLQYDb3UsDq h6VGhi6uJrIcVjIlf+OJTPX//5upwhhKCQ7yPd75LlSAasTTekrct+pdtwgUClzkrtBs DKf9z7mr417z+d4/K+Zi1lgZKvWdOoNNn+k9WSXuC/NNe5Fzs1iPfmrDdv6MMjBU1QgJ RZbDWoynEwoAqECV/Vv5K7TKter9Lqp7KsBQYbjllQrJzgzQlbjbjDwH7boDKl4030wG li3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+vGukS6+Y2S5WypwpEDTAWeIMK1P7++z4QUGaRFK+Y8=; b=Kufb6LQfoBPzRyB3S/1jZp+Y7IAYG3tkLsD4BsLRkVOF/uXxOWJn42JYQ4akmh8vrG AsMWQqwq4winPCx186AnVmk+ImGAKraG559sNCFBaOZqhwvNFW9PQs3b+guGdGrboiqs yvTpUhRTKU857Cf8rL66e/6WV2CPAEE/K8AcMLPK/6Iq7YEpZjzjVk+B/zFj9LXApa3N HixKy25hAElPx5jflFeWfaxILCxKL+IrYnVVrMPD7cm2ADk+MLm+WxtWcUtDN9DzKEGb FQ5QNUDmS0VtAyeOlMlicE6XbkC3uRp9tfEnwB+PgJE0BTpW0kFePNDeMDGirDJtK7mB wOog== X-Gm-Message-State: AMCzsaUjfUMA/qY/WLVgpU0lLFErYJDt556zlMyGt6Wb0Rp+TLHm8OKn 6uD7OAuwZU9YR+oCO4nSXEh4y5kS X-Google-Smtp-Source: ABhQp+QPdlGSPL8RqVkat5Nyufikc4vb/XBQPRIZtJN3b31rjxqgfsoyrAgmODHsjRIhrB0RWhBeTg== X-Received: by 10.98.100.210 with SMTP id y201mr3855349pfb.178.1509211943804; Sat, 28 Oct 2017 10:32:23 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:23 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:56 -0700 Message-Id: <1509211918-14829-10-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 09/11] tnl-neigh-cache: Fix possible null pointer. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer '&wc->masks.ipv6_src' to memset. Workaround it by adding extra pointer check. Signed-off-by: William Tu --- lib/tnl-neigh-cache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tnl-neigh-cache.c b/lib/tnl-neigh-cache.c index a28ce1de8855..b3024848b8d5 100644 --- a/lib/tnl-neigh-cache.c +++ b/lib/tnl-neigh-cache.c @@ -178,6 +178,9 @@ tnl_nd_snoop(const struct flow *flow, struct flow_wildcards *wc, return EINVAL; } + if (OVS_UNLIKELY(!wc)) + return EINVAL; + memset(&wc->masks.ipv6_src, 0xff, sizeof wc->masks.ipv6_src); memset(&wc->masks.ipv6_dst, 0xff, sizeof wc->masks.ipv6_dst); memset(&wc->masks.nd_target, 0xff, sizeof wc->masks.nd_target); From patchwork Sat Oct 28 17:31:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gC+9CGxF"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPScn3cVlz9t0F for ; Sun, 29 Oct 2017 04:37:45 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7A6C3AAB; Sat, 28 Oct 2017 17:32:30 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 73C30A88 for ; Sat, 28 Oct 2017 17:32:25 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 38C7D203 for ; Sat, 28 Oct 2017 17:32:25 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id 15so7736448pgc.12 for ; Sat, 28 Oct 2017 10:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=PmEAQf0xiCZ4rDImq2lnkciCNx0oIEyhNSRuiDVZ6Cc=; b=gC+9CGxFN2ecbtUznuTk4GrBb8cbAuC8B7AmMQ5zNmB14QXFyFMY0Efh8yKyhDjHD4 C1jgWuu1OUCoeuL6ZTPgu+N1+hUbid4btmCPoQwCLwiQjYuwRPUR7y09r1sEa9cmywTM RSUC4licUFqifQv9KvUNtaejD+zT/9/5Mp/W8aFYZKyJdbjjeaHjo4PPdZoL/lv+738h vHrABOlq1bdPTgo2ggfkhyknq9kfcCNLr1rWYmjV/xS8KpXf7yQv9TCMUxhjSMb8cKJx jSSrYmglqcZixDxsameJtQsjYxkGJnNZlk7LwcqxxUHmpKiJeiY0GQZy/ZcweqOHcNlS FBvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=PmEAQf0xiCZ4rDImq2lnkciCNx0oIEyhNSRuiDVZ6Cc=; b=paW/paMGS2WXF+t1N1cSiKuilg5ggJ9UfJGzewCeGmA3wGqEvLuUQ8O63sdn/IK6+O S2uMkr3FZ0WE3Ll+yUsYjJW5FhleUZvF+qL8kCgW9ISZ96dfULtGUCDEzet6k5IahvhP /2GbouH+vNLPkYovX2lARXWVzBBq4ksWjpz6AinnV3e3xwL6LFm2GLqSnTjkwphIl/Xe VbwJ5p1QxBZn14FOrmpWcprcNAMUJYB5h4CuYmZfKZtCSAvE+LE1k3g+Oaa5HMKYRjD1 dTkzOWDY6YGfxmZcbZ500q+VsFYzFVSM8fYonvZG2flPGhAEV6vsYHi5/ytqdNvEHXe7 pAjA== X-Gm-Message-State: AMCzsaU3FOdDCrGwT4YIunqXr3tfauFbyMABiToTiVZXUn0V1k3nDIvg W8gvbI6BTk7K69Ywdf5DYgI485+s X-Google-Smtp-Source: ABhQp+ShUzYiaqcZSKedbR6acmm2WgZR6tjJUk9SKgnouQW366313O6YXeMaPAdJnLswQ1cx31+JpQ== X-Received: by 10.98.214.76 with SMTP id r73mr3894690pfg.261.1509211944669; Sat, 28 Oct 2017 10:32:24 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:24 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:57 -0700 Message-Id: <1509211918-14829-11-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 10/11] lib: Fix possible null pointer to execvp. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible null pointer 'argv[0]' to execvp. Fix it by adding ovs_assert check. Signed-off-by: William Tu Acked-by: Mark Michelson --- lib/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/process.c b/lib/process.c index 254052f2c27d..0b8f994f9b75 100644 --- a/lib/process.c +++ b/lib/process.c @@ -275,6 +275,7 @@ process_start(char **argv, struct process **pp) close(fd); } xpthread_sigmask(SIG_SETMASK, &prev_mask, NULL); + ovs_assert(argv[0]); execvp(argv[0], argv); fprintf(stderr, "execvp(\"%s\") failed: %s\n", argv[0], ovs_strerror(errno)); From patchwork Sat Oct 28 17:31:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 831637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tXIwPAoR"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yPSdN6zVPz9t0F for ; Sun, 29 Oct 2017 04:38:16 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 693E5A95; Sat, 28 Oct 2017 17:32:31 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 7B08A94F for ; Sat, 28 Oct 2017 17:32:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3D6F746F for ; Sat, 28 Oct 2017 17:32:26 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id r25so7751084pgn.4 for ; Sat, 28 Oct 2017 10:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=7qolU1ytgHKmxFFvOzZSGDsTLLqN3d6J+Uij12C4qRs=; b=tXIwPAoR3Sanbob+SQ4EE4hOuMu6tNC20BAG9U2u6A+cYJtfgmmGM26NklDOlrrWYd pwVtq6AZolASR+OgZBhGzGYc2lqkiXbGj5BlpY2h+Nou7MsrukNS280NDpXv+z3X8lmj bT0Js/XLAfzhG3UGf76H2MNIy2qEjBk/doa0vyeOI8imsA/ZVaex5ZzRVRolGkfIUjbD um46HiIOL4rAGxsozsuH3gZz5g8K2w8qIOkq8aiVKWcnAf2dHKC2HqcY+eyN10PPfq/M e4WBaHtklCyDulxfYFeI1rAzNYOb0Gj2jEnkX59Gr9puWLxZwnOgXvxx9J+7Y517Q6po EJKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=7qolU1ytgHKmxFFvOzZSGDsTLLqN3d6J+Uij12C4qRs=; b=dwhE6ebykLBJc1Aue4gg51HTOtwDEnvXW3v/l05+Tb+a1jwfhoMXhPK0Bi+7O3Zi3d anvRbamJp4bmz15nt8SY0LbSpeL5SHO3b6fdCu0dXUgyPP2ThJqpgJdto6FG6sXQvUeE lfY5ziBECwlAtEJyoenwZ16JSnEW4V6caaspNGEfMWkqQnwG0wAwHW9yUcC+roymg4He Bbg/3hyZLHr6Nsw7mp3fGJPC549/F4kT5r1iQrr9ac1zCIEh+OC0w594ua53tkqK71AT 3Mr+aRh1ZpBUbMHZ/+xmw36V0dUaV0fOHjjuZbTZYNbMcNCQfwpD47GO2gRkrOUo5Y1N 8j/g== X-Gm-Message-State: AMCzsaXLrVGLrqy+rQlym1qQYW3DpmYcVLMny9wA/5G2jRRsIubOd4Kp bcd5PEBgYH38kPQf8BgK29yCCNdx X-Google-Smtp-Source: ABhQp+S+607KvCc0a11o0P0tszffX5Z1rJTH+gSpdMugkhGS5+rnUIKwuzu/VPC7PiD+f17s47SR0Q== X-Received: by 10.99.6.18 with SMTP id 18mr3352160pgg.389.1509211945662; Sat, 28 Oct 2017 10:32:25 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([24.5.191.4]) by smtp.gmail.com with ESMTPSA id x1sm18675418pfh.113.2017.10.28.10.32.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Oct 2017 10:32:24 -0700 (PDT) From: William Tu To: ovs-dev@openvswitch.org Date: Sat, 28 Oct 2017 10:31:58 -0700 Message-Id: <1509211918-14829-12-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509211918-14829-1-git-send-email-u9012063@gmail.com> References: <1509211918-14829-1-git-send-email-u9012063@gmail.com> X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 11/11] ovs-testcontroller: Fix possible null pointer to atoi. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Clang reports possible optarg as null passed to atoi. Fix it by adding ovs_assert check. Signed-off-by: William Tu Acked-by: Mark Michelson --- utilities/ovs-testcontroller.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utilities/ovs-testcontroller.c b/utilities/ovs-testcontroller.c index b4a451286455..be28d5494ec0 100644 --- a/utilities/ovs-testcontroller.c +++ b/utilities/ovs-testcontroller.c @@ -318,6 +318,7 @@ parse_options(int argc, char *argv[]) if (!strcmp(optarg, "permanent")) { max_idle = OFP_FLOW_PERMANENT; } else { + ovs_assert(optarg); max_idle = atoi(optarg); if (max_idle < 1 || max_idle > 65535) { ovs_fatal(0, "--max-idle argument must be between 1 and " @@ -327,6 +328,7 @@ parse_options(int argc, char *argv[]) break; case 'q': + ovs_assert(optarg); default_queue = atoi(optarg); break;