From mboxrd@z Thu Jan 1 00:00:00 1970 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 38B20C433DF for ; Fri, 19 Jun 2020 14:47:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0630A217BA for ; Fri, 19 Jun 2020 14:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578033; bh=3Gy/92jLZF+v7FYdCtBsRReY/y1P8gmS+TEu783FoGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EbwKpMsm+6Plvea4tN7ApPo78tFypX18WcoxjgwHJOpOC/5D4rZH6zuRwXPxghCGZ 5pGXLPzlhmBmHMc1/3HtyTUpDkHq3x1tA8C81L4w7QP9CCYwh7zMHRrscSX4xq32v5 z5lQScoADR9mASVmrXqu8i2LjJLGzVYHyjX4RimU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388919AbgFSOrH (ORCPT ); Fri, 19 Jun 2020 10:47:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:39104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388915AbgFSOrF (ORCPT ); Fri, 19 Jun 2020 10:47:05 -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 C7439217BA; Fri, 19 Jun 2020 14:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578024; bh=3Gy/92jLZF+v7FYdCtBsRReY/y1P8gmS+TEu783FoGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t9tos96goJJO3JMzKyIbDbM8BeHKpmw9riWQuKzB93CO3RGda0eh7sHzpQB24jL85 gdYZieNq7Kb4bAEBswqP1KF2/4ZVmC4zO9nRyNPiDLgsL/GiBSk14ntQq/HWLS+JOP FxWSdKqwijqZfV6pmJQgHEuClO76V4OKkoKm1qhs= 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 4.14 052/190] selftests/net: in rxtimestamp getopt_long needs terminating null entry Date: Fri, 19 Jun 2020 16:31:37 +0200 Message-Id: <20200619141636.187659962@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141633.446429600@linuxfoundation.org> References: <20200619141633.446429600@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 @@ -114,6 +114,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;