Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932748AbeAIXqM (ORCPT + 1 other); Tue, 9 Jan 2018 18:46:12 -0500 Received: from mail-vk0-f65.google.com ([209.85.213.65]:35664 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932224AbeAIXqK (ORCPT ); Tue, 9 Jan 2018 18:46:10 -0500 X-Google-Smtp-Source: ACJfBov6x20kmAAy8fkqiA2/MSR4+0YZloDpXyYDi8Xuh2El3p6wOzlhv+eINO/1HGZ1EameJTVXhHCy8I1ns3BSn9I= MIME-Version: 1.0 In-Reply-To: <27f8bd36-4757-1c9c-b8b7-676483da1e0e@kernel.org> References: <20180105163118.22598-1-anders.roxell@linaro.org> <27f8bd36-4757-1c9c-b8b7-676483da1e0e@kernel.org> From: Kees Cook Date: Tue, 9 Jan 2018 15:46:08 -0800 X-Google-Sender-Auth: ywVeWqgEsyD9myNDJcUBiB1fpxI Message-ID: Subject: Re: [PATCH] selftests: seccomp: fix compile error seccomp_bpf To: Shuah Khan Cc: Naresh Kamboju , Anders Roxell , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , Will Drewry , Andy Lutomirski , Shuah Khan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 9, 2018 at 3:37 PM, Shuah Khan wrote: > On 01/09/2018 04:25 PM, Kees Cook wrote: >> On Tue, Jan 9, 2018 at 3:24 PM, Kees Cook wrote: >>> On Tue, Jan 9, 2018 at 3:07 PM, Kees Cook wrote: >>>> On Fri, Jan 5, 2018 at 6:29 PM, Naresh Kamboju >>>> wrote: >>>>> On 5 January 2018 at 22:01, Anders Roxell wrote: >>>>>> aarch64-linux-gnu-gcc -Wl,-no-as-needed -Wall >>>>>> -lpthread seccomp_bpf.c -o seccomp_bpf >>>>>> seccomp_bpf.c: In function 'tracer_ptrace': >>>>>> seccomp_bpf.c:1720:12: error: '__NR_open' undeclared >>>>>> (first use in this function) >>>>>> if (nr == __NR_open) >>>>>> ^~~~~~~~~ >>>>>> seccomp_bpf.c:1720:12: note: each undeclared identifier is reported >>>>>> only once for each function it appears in >>>>>> In file included from seccomp_bpf.c:48:0: >>>>>> seccomp_bpf.c: In function 'TRACE_syscall_ptrace_syscall_dropped': >>>>>> seccomp_bpf.c:1795:39: error: '__NR_open' undeclared >>>>>> (first use in this function) >>>>>> EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_open)); >>>>>> ^ >>>>>> open(2) is a legacy syscall, replaced with openat(2) since 2.6.16. >>>>>> Thus new architectures in the kernel, such as arm64, don't implement >>>>>> these legacy syscalls. >>>>>> >>>>>> Signed-off-by: Anders Roxell >>>>> >>>>> Thanks for the patch Anders. >>>>> Tested-by: Naresh Kamboju >>>> >>>> Did something change recently? This has built fine on arm64 for a >>>> while -- at least since commit 256d0afb11d6 ("selftests/seccomp: build >>>> and pass on arm64"). >>> >>> Ah, found it. I broke it in a33b2d0359a0! :) Shuah, can you take this >>> please, with this tag added: >>> >>> Fixes: a33b2d0359a0 ("selftests/seccomp: Add tests for basic ptrace actions") >> >> And Cc to stable, as this was broken in 4.14... >> >> Cc: stable@vger.kernel.org >> >> -Kees >> > > Thanks Kees. Yes I will get this into 4.16-rc1. Okay to add your > Acked-by I assume. Yes, thanks! Here it is all together: Fixes: a33b2d0359a0 ("selftests/seccomp: Add tests for basic ptrace actions") Cc: stable@vger.kernel.org Acked-by: Kees Cook -Kees -- Kees Cook Pixel Security