public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: Richard Palethorpe <rpalethorpe@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1 2/2] ptrace06: Refactor the test using new LTP API
Date: Tue, 28 Nov 2023 10:51:49 +0100	[thread overview]
Message-ID: <20231128095149.GA356525@pevik> (raw)
In-Reply-To: <20230925112245.30701-3-wegao@suse.com>

Hi Wei,

note ptrace06 was not even been compiled. I tested that even in old API it
worked, thus I re-enable it in patch

https://patchwork.ozlabs.org/project/ltp/patch/20231128091524.340808-3-pvorel@suse.cz/
(part of https://patchwork.ozlabs.org/project/ltp/list/?series=384172&state=*)

> +++ b/testcases/kernel/syscalls/ptrace/ptrace06.c
> @@ -1,32 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0-only
Again:
// SPDX-License-Identifier: GPL-2.0-or-later
>  /*
> + * Copyright (c) 2008 Analog Devices Inc.
> + * Copyright (c) 2023 Wei Gao <wegao@suse.com>
> + */
> +
> +/*\
> + * [Description]
> + *
>   * check out-of-bound/unaligned addresses given to
Without missing blank line here the list will not be working.
>   *  - {PEEK,POKE}{DATA,TEXT,USER}
>   *  - {GET,SET}{,FG}REGS
>   *  - {GET,SET}SIGINFO
>   *
Why this blank line above?

> - * Copyright (c) 2008 Analog Devices Inc.
> - *
> - * Licensed under the GPL-2 or later
... because this:
>   */

>  #define _GNU_SOURCE
This might not be needed (needs to be verified in CI if also the oldest distros
does not need it).

>  /* this should be sizeof(struct user), but that info is only found
>   * in the kernel asm/user.h which is not exported to userspace.
>   */
> +
>  #if defined(__i386__)
>  #define SIZEOF_USER 284
>  #elif defined(__x86_64__)
> @@ -35,168 +34,213 @@
>  #define SIZEOF_USER 0x1000	/* just pick a big number */
>  #endif

I wonder if this SIZEOF_USER is valid. I haven't found what value they mean
(they talk about arch/*/include/asm/user*.h in kernel).

> -char *TCID = "ptrace06";
> -
>  struct test_case_t {
>  	int request;
>  	long addr;
>  	long data;
>  } test_cases[] = {
>  	{
> +	PTRACE_PEEKDATA, .addr = 0}, {
> +	PTRACE_PEEKDATA, .addr = 1}, {
IMHO This is ugly formatting, brackets shold be always on the same place.
.e.g 
{ PTRACE_PEEKDATA, .addr = 0},
{ PTRACE_PEEKDATA, .addr = 1},


> +	PTRACE_PEEKDATA, .addr = 2}, {
> +	PTRACE_PEEKDATA, .addr = 3}, {
> +	PTRACE_PEEKDATA, .addr = -1}, {
> +	PTRACE_PEEKDATA, .addr = -2}, {
...
> +static void child(void)
> +{
> +	SAFE_PTRACE(PTRACE_TRACEME, 0, NULL, NULL);
> +	execl("/bin/echo", "/bin/echo", NULL);
This will not work for AOSP (Android). Maybe adding ptrace06_child.c with very
simple code (printf or tst_res(TINFO) something, use TST_NO_DEFAULT_MAIN) would
be better.

> +	exit(0);
> +}

...

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2023-11-28  9:53 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 11:22 [LTP] [PATCH v1 0/2] ptrace: Refactor Wei Gao via ltp
2023-09-25 11:22 ` [LTP] [PATCH v1 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2023-11-28  8:57   ` Richard Palethorpe
2023-11-28  9:24   ` Petr Vorel
2023-09-25 11:22 ` [LTP] [PATCH v1 2/2] ptrace06: " Wei Gao via ltp
2023-11-28  9:31   ` Richard Palethorpe
2023-11-28  9:51   ` Petr Vorel [this message]
2023-12-01  1:06     ` Wei Gao via ltp
2023-12-01  0:59 ` [LTP] [PATCH v2 0/2] ptrace: Refactor Wei Gao via ltp
2023-12-01  0:59   ` [LTP] [PATCH v2 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2024-02-08 16:15     ` Andrea Cervesato via ltp
2023-12-01  0:59   ` [LTP] [PATCH v2 2/2] ptrace06: " Wei Gao via ltp
2024-02-08 16:25     ` Andrea Cervesato via ltp
2024-06-03 10:35   ` [LTP] [PATCH v3 0/2] ptrace: Refactor Wei Gao via ltp
2024-06-03 10:35     ` [LTP] [PATCH v3 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2024-06-28 15:35       ` Cyril Hrubis
2024-06-03 10:35     ` [LTP] [PATCH v3 2/2] ptrace06: " Wei Gao via ltp
2024-06-28 16:15       ` Cyril Hrubis
2024-12-17  6:16     ` [LTP] [PATCH v4 0/2] ptrace: Refactor Wei Gao via ltp
2024-12-17  6:16       ` [LTP] [PATCH v4 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2025-01-08 13:39         ` Petr Vorel
2024-12-17  6:16       ` [LTP] [PATCH v4 2/2] ptrace06: " Wei Gao via ltp
2025-01-09  8:55         ` Petr Vorel
2025-01-13  8:16       ` [LTP] [PATCH v5 0/2] ptrace: Refactor Wei Gao via ltp
2025-01-13  8:16         ` [LTP] [PATCH v5 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2025-01-13 16:02           ` Cyril Hrubis
2025-01-13 21:40             ` Petr Vorel
2025-01-14  9:25               ` Cyril Hrubis
2025-01-13  8:16         ` [LTP] [PATCH v5 2/2] ptrace06: " Wei Gao via ltp
2025-01-14 12:40         ` [LTP] [PATCH v6 0/2] ptrace: Refactor Wei Gao via ltp
2025-01-14 12:40           ` [LTP] [PATCH v6 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2025-01-14 13:05             ` Cyril Hrubis
2025-01-14 12:40           ` [LTP] [PATCH v6 2/2] ptrace06: " Wei Gao via ltp
2025-01-14 14:32           ` [LTP] [PATCH v7 0/2] ptrace: Refactor Wei Gao via ltp
2025-01-14 14:32             ` [LTP] [PATCH v7 1/2] ptrace05: Refactor the test using new LTP API Wei Gao via ltp
2025-01-16 16:44               ` Cyril Hrubis
2025-01-14 14:32             ` [LTP] [PATCH v7 2/2] ptrace06: " Wei Gao via ltp
2025-01-16 16:50               ` Cyril Hrubis
2025-01-17 10:40               ` Petr Vorel
2025-01-17 10:42                 ` Cyril Hrubis
2025-01-17 11:12                   ` Petr Vorel
2025-01-20  4:14             ` [LTP] [PATCH v8 0/2] ptrace: Refactor Wei Gao via ltp
2025-01-20  4:14               ` [LTP] [PATCH v8 1/2] ptrace06: Refactor the test using new LTP API Wei Gao via ltp
2025-01-20 13:35                 ` Petr Vorel
2025-01-20  4:14               ` [LTP] [PATCH v8 2/2] ptrace06_child.c: Remove unused ptrace06_child.c Wei Gao via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231128095149.GA356525@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.com \
    --cc=wegao@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox