From patchwork Tue May 12 15:22:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1288553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=a6Mp2E2R; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49M1mG0s2qz9sRY for ; Wed, 13 May 2020 01:23:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 052A026509; Tue, 12 May 2020 15:23:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hcL9CGK7qQw7; Tue, 12 May 2020 15:23:35 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 721A8263F9; Tue, 12 May 2020 15:23:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 584EFC088A; Tue, 12 May 2020 15:23:20 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0C114C016F for ; Tue, 12 May 2020 15:23:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EDF6186B3B for ; Tue, 12 May 2020 15:23:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UqClXrU71oqA for ; Tue, 12 May 2020 15:23:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id D30728867D for ; Tue, 12 May 2020 15:23:17 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id v63so6507076pfb.10 for ; Tue, 12 May 2020 08:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=aDxlP9nVgMCrrANFgVRWvU9kzYBO3FCoUsiyzf2Rldc=; b=a6Mp2E2RrpjxR8JP5dXlSlphoWwxsxQY/gbYfzCfGd5ij2qLu4U+1FbcTPtcFDwbtj wdedtOJ8xqE7ix3Dft4TRNFsi3SgKWdf25h4k7Op//7wJ2zMk7Is1tFqzlCimcKS+kPW nPds/R9kU6l7oKzR0rUJoZCJgU20Vqz0jlxGDHWB1c1LPfIjOP2CEGDXWBZxpbCLzNbD +JWgwONT7WWIMTQW1qxiVQ7TpDEg4dLDni9Y8YCa5m2gbDq7m9g6u7w2kxqnUNyySA8K GBH/a+oEFRwEMhi9652CEY4E71vgeASJChAx8ZCL2AWGQ++3Vj8RdF9iwxmpCZ0YiBRK sEWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aDxlP9nVgMCrrANFgVRWvU9kzYBO3FCoUsiyzf2Rldc=; b=r7n+I+hKlMPXmEFz5e6VUGZs/Bl9YsxrULtNS84TxPSCCCs49O9ejek7JTPaE3Bhh+ cYS43ZsYu3TetbN/X7zNYXuhBtLY72PN2NPXP37lnwikgoAWwlv54nAZSrZc+4C40Wa/ RFzi1pGQS0fhwoZML4Zv+zPVMea+h/lAPep65TohAv9lxPik+JCZNmc4YyLaQhIUXvzd /uHx88E/aznK05KMT7rBxs3ZzJAc7V4RNjN8DoAD+xm89+aN4or7SLwYrolw9LoiJ7Hp ZjL1XB5dKQDH5Orx2TLl6HrDLyou3ZziiMhSlSbxPqcVkHu1jqb2O96XRCFVhVZQLAuh bjTg== X-Gm-Message-State: AGi0PuZOyukLPAcKNSfIvVlNvqU5XB3vVPCsdhB12FXN4OF8ghpq3jOP Tm+8Xlqn8v3HVp96lNT4hjPEtJiZZ6g= X-Google-Smtp-Source: APiQypKPiKNkIxbGMoMQltFLoSQ3t9GsTJ3Ear/UhkmodQblpkqXOy9uabVCw0BfNRNxaeH1OtkaYQ== X-Received: by 2002:a62:7b51:: with SMTP id w78mr21936708pfc.300.1589296997132; Tue, 12 May 2020 08:23:17 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id m19sm13105032pjv.30.2020.05.12.08.23.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2020 08:23:16 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Tue, 12 May 2020 08:22:30 -0700 Message-Id: <1589296951-75730-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Cc: Bhargava Shastry Subject: [ovs-dev] [PATCH 1/2] oss-fuzz: Fix fuzzer flags in CFLAGS. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When running fuzzer locally by doing $ ./configure CC=clang CFLAGS="-g -O2 -fsanitize=fuzzer-no-link -Werror" $ make oss-fuzz-targets fails due to "(.text+0x20): undefined reference to `main'" The patch fixes it by replacing "fuzzer-no-link" to "fuzzer" so the binary under tests/oss-fuzz/ can be generated. Cc: Bhargava Shastry Cc: Yifeng Sun Signed-off-by: William Tu --- tests/oss-fuzz/automake.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/oss-fuzz/automake.mk b/tests/oss-fuzz/automake.mk index 2b116e7a51a1..66a5c3037f5d 100644 --- a/tests/oss-fuzz/automake.mk +++ b/tests/oss-fuzz/automake.mk @@ -8,6 +8,9 @@ OSS_FUZZ_TARGETS = \ EXTRA_PROGRAMS += $(OSS_FUZZ_TARGETS) oss-fuzz-targets: $(OSS_FUZZ_TARGETS) +CFLAGS_FUZZER:=$(CFLAGS:fuzzer-no-link=fuzzer) +override CFLAGS=$(CFLAGS_FUZZER) + tests_oss_fuzz_flow_extract_target_SOURCES = \ tests/oss-fuzz/flow_extract_target.c \ tests/oss-fuzz/fuzzer.h From patchwork Tue May 12 15:22:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1288551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XLM+OgwN; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49M1lw03Gjz9sRf for ; Wed, 13 May 2020 01:23:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 720B089401; Tue, 12 May 2020 15:23:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hTHFowlYMfM4; Tue, 12 May 2020 15:23:21 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 45726893FE; Tue, 12 May 2020 15:23:21 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2A7E8C088E; Tue, 12 May 2020 15:23:21 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2348EC016F for ; Tue, 12 May 2020 15:23:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 12D178867D for ; Tue, 12 May 2020 15:23:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4KEXkwD3x685 for ; Tue, 12 May 2020 15:23:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0FD9C86B3B for ; Tue, 12 May 2020 15:23:19 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id z15so761797pjb.0 for ; Tue, 12 May 2020 08:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/c+dDrnqQsQWnGZ3v8LQJkZvhDe/vcgSg+lGRaF+3x4=; b=XLM+OgwN8bV8M7+p5BEGkiP5+JacR5CfPFLP2fYQIaJi+KzOufNMBoXEyHXGdbvSST A4aMjAW7ZW9NoXHlbYM7cKZ1A+8KwJn7T/ILl7J5vv7DBxrGxB6LJhhPnFrJFJ05ltFR FIvCIJNM2rCrt5ZrBBbUDoq3OepxzpeXgfSHD/1rPAaKmenTnhu3fj4G5mj0FoOEB33K UkRdDePnD8T1UemqvzWxXl+q1N0NJG6zOXiAV2+dHsc6QGPLBsWoTj0pTUSrzNYfLA1/ Svln9T4TTKUcJ3RlmDy0C8/9sCFBOMKztq7wTupFz4lH7ReC7QtSjulJBP+WAQBQuSIr FKvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/c+dDrnqQsQWnGZ3v8LQJkZvhDe/vcgSg+lGRaF+3x4=; b=jY1YUIzq7PVy12npznM/UaFna+4dVxDChh3pAv/SHBlD/+z9dKrj1mWrym2P1PN1Fc W41jN5BlGPJk0HNHjxJ4L4cbh/9pU0j6aqdlEo1kXlJ17tXeA7Z08Mtj32ARjXasSp1m clysNqqUKXWBwLwdV39JW5CULDRSOMONsvwm8Fje9zX3UP/pc5RpKDYpD5iMfFf7028d 0zMCeeIZ3/f0rr3S9bTKv/+NzZKkSx3WRuSoduXq0OPw6eOxI59RsehAJcCa7tDuRr3b 4HjW2YYy+2kJ7C8GpZ92Uj8VmnpmBxAF4CiQoHp6djiQ3FEt/CAgUb90ELPgD4t7HSNi 97HA== X-Gm-Message-State: AGi0PuZ1HRnTvRsv5816ze5yPvdQ5nbRIXzBxhlJuhIdVMhgKlh3D66h wqyBGc+DVGS1uM5+F4kC+uGs5bLfAg8= X-Google-Smtp-Source: APiQypLrQLjd0wTAhOoY/GMXUZYD2DV97KXloedgBKH9nNYVn7I5oWH55ZCsNiIsHabvKsJ5gH3RJQ== X-Received: by 2002:a17:90a:fc89:: with SMTP id ci9mr28880867pjb.140.1589296998012; Tue, 12 May 2020 08:23:18 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (c-76-21-95-192.hsd1.ca.comcast.net. [76.21.95.192]) by smtp.gmail.com with ESMTPSA id m19sm13105032pjv.30.2020.05.12.08.23.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2020 08:23:17 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Tue, 12 May 2020 08:22:31 -0700 Message-Id: <1589296951-75730-2-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589296951-75730-1-git-send-email-u9012063@gmail.com> References: <1589296951-75730-1-git-send-email-u9012063@gmail.com> Cc: Bhargava Shastry Subject: [ovs-dev] [PATCH 2/2] oss-fuzz: Fix miniflow_target.c. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Clang reports: tests/oss-fuzz/miniflow_target.c:209:26: error: suggest braces around \ initialization of subobject [-Werror,-Wmissing-braces] struct flow flow2 = {0}; Fix it by using memset. Cc: Bhargava Shastry Cc: Yifeng Sun Signed-off-by: William Tu Reviewed-by: Yifeng Sun --- tests/oss-fuzz/miniflow_target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/oss-fuzz/miniflow_target.c b/tests/oss-fuzz/miniflow_target.c index 393443061e85..50b8b0e64237 100644 --- a/tests/oss-fuzz/miniflow_target.c +++ b/tests/oss-fuzz/miniflow_target.c @@ -206,8 +206,9 @@ test_minimask_combine(struct flow *flow) struct minimask minicombined; uint64_t storage[FLOW_U64S]; } m; - struct flow flow2 = {0}; + struct flow flow2; + memset(&flow2, 0, sizeof flow2); mask.masks = *flow; minimask = minimask_create(&mask);