From patchwork Thu Apr 16 13:22:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 227701 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 67AFAC352BE for ; Thu, 16 Apr 2020 15:04:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4223C206D9 for ; Thu, 16 Apr 2020 15:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587049441; bh=vDbC//cFoiarsCOyRPOI0FBifzs1I3USmWge+kKgjaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0awd5q17iGitiduP0Rdce5wpE500sXWOJAZdJeTh7PXslFcKHZ/kcX95QxD4kk3O3 z3gDhFAQC6onMEIpFplIGsREOJpWcyV/BEbIZwZlmSNt5jAZ3o5PEqt3YH1I0o32fk 61oLs8vrnjm0BM3cWA+iX5vOuD0CkmWS6/no5xjk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442013AbgDPPDr (ORCPT ); Thu, 16 Apr 2020 11:03:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:39856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408992AbgDPNxZ (ORCPT ); Thu, 16 Apr 2020 09:53:25 -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 C679720732; Thu, 16 Apr 2020 13:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587045205; bh=vDbC//cFoiarsCOyRPOI0FBifzs1I3USmWge+kKgjaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v4U6RxbvAb8SH1KNpmrUmfM01SmjcvOzI5w59nPPeaFVAB4OWLdby9jaNLvKgJS2v Id5a2/Whvk8iXpajvIfN53d+gdPfqaUTSEZdS5M3IZaNd/jB19fof9QXh/EGmplfUX zGHINFAqTNQ3HlgjsMz1DZu/MepxI0/CdgXrNDSY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Andy Lutomirski , Borislav Petkov , Sasha Levin Subject: [PATCH 5.6 038/254] selftests/x86/ptrace_syscall_32: Fix no-vDSO segfault Date: Thu, 16 Apr 2020 15:22:07 +0200 Message-Id: <20200416131330.625241721@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131325.804095985@linuxfoundation.org> References: <20200416131325.804095985@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: Andy Lutomirski [ Upstream commit 630b99ab60aa972052a4202a1ff96c7e45eb0054 ] If AT_SYSINFO is not present, don't try to call a NULL pointer. Reported-by: kbuild test robot Signed-off-by: Andy Lutomirski Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/faaf688265a7e1a5b944d6f8bc0f6368158306d3.1584052409.git.luto@kernel.org Signed-off-by: Sasha Levin --- tools/testing/selftests/x86/ptrace_syscall.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c index 6f22238f32173..12aaa063196e7 100644 --- a/tools/testing/selftests/x86/ptrace_syscall.c +++ b/tools/testing/selftests/x86/ptrace_syscall.c @@ -414,8 +414,12 @@ int main() #if defined(__i386__) && (!defined(__GLIBC__) || __GLIBC__ > 2 || __GLIBC_MINOR__ >= 16) vsyscall32 = (void *)getauxval(AT_SYSINFO); - printf("[RUN]\tCheck AT_SYSINFO return regs\n"); - test_sys32_regs(do_full_vsyscall32); + if (vsyscall32) { + printf("[RUN]\tCheck AT_SYSINFO return regs\n"); + test_sys32_regs(do_full_vsyscall32); + } else { + printf("[SKIP]\tAT_SYSINFO is not available\n"); + } #endif test_ptrace_syscall_restart();