From patchwork Tue Jun 16 15:34:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65445C433E1 for ; Tue, 16 Jun 2020 15:53:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 409C0208D5 for ; Tue, 16 Jun 2020 15:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322798; bh=ZXs9ocW7Ed+eH9yAMQJE98d/MX0NoYJxO6UE9FsODYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gTdD4PHOxwpg0chlCNb/f3BF0Kxp9N9xon/LQkyAVXSRZqYZzKCGQY2D8e+QFcYlr hhDy0DNgBE9Tvo6tRPhLl4zdMFye2YA67sBiAZqYHkSnUzvoir/U6C6J9/LrJhMfwC PmeugdKckkK/HqNiJQ/d+A/HX51LA5Ok+3ZCrcY4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732845AbgFPPxR (ORCPT ); Tue, 16 Jun 2020 11:53:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732645AbgFPPxQ (ORCPT ); Tue, 16 Jun 2020 11:53:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40C4E207C4; Tue, 16 Jun 2020 15:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322796; bh=ZXs9ocW7Ed+eH9yAMQJE98d/MX0NoYJxO6UE9FsODYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bqUIqtsIzFHPuhzYUQgpbQ0Fb6Zj3p5KTJ1LqHEBunrJQ0rAsAVqcKnGP/+Xu9ZwR i/bV3HnRO14bCg2cV1pua992JECcZVzEMcSYp+E/bntjND5RkYk5z5LFJoFHXVw5+5 aut8I9G3+GQg8VX09VROOl17znYjWggU0Du9Q8po= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tanner Love , Willem de Bruijn , "David S. Miller" Subject: [PATCH 5.6 108/161] selftests/net: in rxtimestamp getopt_long needs terminating null entry Date: Tue, 16 Jun 2020 17:34:58 +0200 Message-Id: <20200616153111.505557328@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.402291280@linuxfoundation.org> References: <20200616153106.402291280@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: tannerlove [ Upstream commit 865a6cbb2288f8af7f9dc3b153c61b7014fdcf1e ] getopt_long requires the last element to be filled with zeros. Otherwise, passing an unrecognized option can cause a segfault. Fixes: 16e781224198 ("selftests/net: Add a test to validate behavior of rx timestamps") Signed-off-by: Tanner Love Acked-by: Willem de Bruijn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/networking/timestamping/rxtimestamp.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/testing/selftests/networking/timestamping/rxtimestamp.c +++ b/tools/testing/selftests/networking/timestamping/rxtimestamp.c @@ -115,6 +115,7 @@ static struct option long_options[] = { { "tcp", no_argument, 0, 't' }, { "udp", no_argument, 0, 'u' }, { "ip", no_argument, 0, 'i' }, + { NULL, 0, NULL, 0 }, }; static int next_port = 19999;