Re: [PATCH v13 3/3] tools/testing - seccomp test fixes for m68k

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CC linux-kselftest

On Thu, Jan 12, 2023 at 4:55 AM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
> Add m68k seccomp definitions to seccomp_bpf self test code.
>
> Tested on ARAnyM.
>
> Signed-off-by: Michael Schmitz <schmitzmic@xxxxxxxxx>
>
> --
> Changes from v12:
>
> Michael Karcher:
> - use correct definition of ARCH_REGS (use of struct pt_regs
>   cause stack overflow on passing register set to user space
>   due to size mismatch, and has some register offsets wrong)

Thanks for the update!
Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
i.e. will queue in the m68k for-v6.3 branch.

> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -138,6 +138,8 @@ struct seccomp_data {
>  #  define __NR_seccomp 337
>  # elif defined(__sh__)
>  #  define __NR_seccomp 372
> +# elif defined(__mc68000__)
> +#  define __NR_seccomp 380
>  # else
>  #  warning "seccomp syscall number unknown for this architecture"
>  #  define __NR_seccomp 0xffff
> @@ -1838,6 +1840,10 @@ TEST_F(TRACE_poke, getpid_runs_normally)
>  # define ARCH_REGS             struct pt_regs
>  # define SYSCALL_NUM(_regs)    (_regs).regs[3]
>  # define SYSCALL_RET(_regs)    (_regs).regs[0]
> +#elif defined(__mc68000__)
> +# define ARCH_REGS     struct user_regs_struct
> +# define SYSCALL_NUM(_regs)    (_regs).orig_d0
> +# define SYSCALL_RET(_regs)    (_regs).d0
>  #else
>  # error "Do not know how to find your architecture's registers and syscalls"
>  #endif
> @@ -1902,7 +1908,7 @@ const bool ptrace_entry_set_syscall_ret =
>   * Use PTRACE_GETREGS and PTRACE_SETREGS when available. This is useful for
>   * architectures without HAVE_ARCH_TRACEHOOK (e.g. User-mode Linux).
>   */
> -#if defined(__x86_64__) || defined(__i386__) || defined(__mips__)
> +#if defined(__x86_64__) || defined(__i386__) || defined(__mips__) || defined(__mc68000__)
>  # define ARCH_GETREGS(_regs)   ptrace(PTRACE_GETREGS, tracee, 0, &(_regs))
>  # define ARCH_SETREGS(_regs)   ptrace(PTRACE_SETREGS, tracee, 0, &(_regs))
>  #else

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux