lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 8 Jul 2019 21:24:26 -0700
From:   Kees Cook <keescook@...omium.org>
To:     "Dmitry V. Levin" <ldv@...linux.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Elvira Khabirova <lineprinter@...linux.org>,
        Oleg Nesterov <oleg@...hat.com>,
        Andy Lutomirski <luto@...nel.org>,
        Eugene Syromyatnikov <esyr@...hat.com>,
        Shuah Khan <shuah@...nel.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        kbuild test robot <lkp@...el.com>,
        LKML <linux-kernel@...r.kernel.org>, lkp@...org
Subject: Re: [PATCH] selftests/seccomp/seccomp_bpf: update for
 PTRACE_GET_SYSCALL_INFO

On Mon, Jul 08, 2019 at 09:29:04PM +0300, Dmitry V. Levin wrote:
> The syscall entry/exit is now exposed via PTRACE_GETEVENTMSG,
> update the test accordingly.

Oh yes, thank you!

Acked-by: Kees Cook <keescook@...omium.org>

-Kees

> 
> Reported-by: kernel test robot <rong.a.chen@...el.com>
> Signed-off-by: Dmitry V. Levin <ldv@...linux.org>
> ---
>  tools/testing/selftests/seccomp/seccomp_bpf.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> index dc66fe852768..6ef7f16c4cf5 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -1775,13 +1775,18 @@ void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee,
>  	unsigned long msg;
>  	static bool entry;
>  
> -	/* Make sure we got an empty message. */
> +	/*
> +	 * The traditional way to tell PTRACE_SYSCALL entry/exit
> +	 * is by counting.
> +	 */
> +	entry = !entry;
> +
> +	/* Make sure we got an appropriate message. */
>  	ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg);
>  	EXPECT_EQ(0, ret);
> -	EXPECT_EQ(0, msg);
> +	EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY
> +			: PTRACE_EVENTMSG_SYSCALL_EXIT, msg);
>  
> -	/* The only way to tell PTRACE_SYSCALL entry/exit is by counting. */
> -	entry = !entry;
>  	if (!entry)
>  		return;
>  
> -- 
> ldv

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ