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 CD9DEC433E1 for ; Tue, 16 Jun 2020 15:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A891120E65 for ; Tue, 16 Jun 2020 15:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322365; bh=IeCCVXsdJ/qXFvYSg7J9mZxVLqajBfphaG43DACof6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PUjuPHlS3e+NCFtZgXlC0nucyARbe4vh/nuERlIaT/e1ZahQJXHAxMFg9JYn4+S2I RV/tjO9D3CXqhNk5BjSko3LXtRmFZVmn1YCvtKmCJuOVHuDv/w8BZ6RbFi7WEFtNdz dosJoJ1yojq8eybAm9luAzpJwkaGP00QSblD5RVU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732156AbgFPPqD (ORCPT ); Tue, 16 Jun 2020 11:46:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732135AbgFPPp6 (ORCPT ); Tue, 16 Jun 2020 11:45:58 -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 6420A2071A; Tue, 16 Jun 2020 15:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322357; bh=IeCCVXsdJ/qXFvYSg7J9mZxVLqajBfphaG43DACof6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RlPwCh28jbyKBCXS1TQ0Da1XFoc1OerJbyKOhcR9foKqq0krPkUMiqvp37bKgR/KN BySJ5pccJ1jxjqeqRSIHePixtB94mgejir3aEipxEQ4SyuFuZAu/HiBdyky5JzyYed KDJqYVAFol8r2bzuu/gW/+DqAWLsftCOi+cO+L9Y= 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.7 101/163] selftests/net: in rxtimestamp getopt_long needs terminating null entry Date: Tue, 16 Jun 2020 17:34:35 +0200 Message-Id: <20200616153111.660877354@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.849127260@linuxfoundation.org> References: <20200616153106.849127260@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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/net/rxtimestamp.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/testing/selftests/net/rxtimestamp.c +++ b/tools/testing/selftests/net/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;