public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: [PATCH v6 2/2] m68k: add kernel seccomp support
Date: Tue, 29 Jun 2021 08:17:22 +1200	[thread overview]
Message-ID: <bc56cc50-3270-53d1-d40f-8f69fe1700d7@gmail.com> (raw)
In-Reply-To: <CAMuHMdWC9sLUdDpscdHAr--iWxKN=qm7Qq9Zu5VOOR9JTrvo0A@mail.gmail.com>

Hi Geert,

On 28/06/21 7:23 pm, Geert Uytterhoeven wrote:
>
>> --- a/arch/m68k/include/asm/syscall.h
>> +++ b/arch/m68k/include/asm/syscall.h
>> @@ -4,6 +4,39 @@
>>
>>   #include <uapi/linux/audit.h>
>>
>> +#include <asm/unistd.h>
>> +
>> +extern const unsigned long sys_call_table[];
>> +
>> +static inline int syscall_get_nr(struct task_struct *task,
>> +                                struct pt_regs *regs)
>> +{
>> +       return regs->orig_d0;
>> +}
>> +
>> +static inline void syscall_rollback(struct task_struct *task,
>> +                                   struct pt_regs *regs)
>> +{
>> +       regs->d0 = regs->orig_d0;
>> +}
>> +
>> +static inline void syscall_set_return_value(struct task_struct *task,
>> +                                           struct pt_regs *regs,
>> +                                           int error, long val)
>> +{
>> +       regs->d0 = (long) error ? error : val;
>> +}
>> +
>> +static inline void syscall_get_arguments(struct task_struct *task,
>> +                                        struct pt_regs *regs,
>> +                                        unsigned long *args)
>> +{
>> +       args[0] = regs->orig_d0;
>> +       args++;
>> +
>> +       memcpy(args, &regs->d1, 5 * sizeof(args[0]));
>> +}
>> +
>>   static inline int syscall_get_arch(struct task_struct *task)
>>   {
>>          return AUDIT_ARCH_M68K;
> Comparing this to what I had before, I noticed syscall_get_return_value()
> is missing.
Yes - I only added the bare minimum I needed to compile.
> Upon closer look, we don't need it (yet), as we don't select any
> of GENERIC_ENTRY, HAVE_ARCH_TRACEHOOK, or HAVE_SYSCALL_TRACEPOINTS,
> but why not add it while we're at it?

I can do that - the trouble with this entire series is that I can't 
meaningfully test anything. But syscall_get_return_value() isn't that 
difficult.

Cheers,

     Michael

>
> Gr{oetje,eeting}s,
>
>                          Geert
>

      reply	other threads:[~2021-06-28 20:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  0:45 [PATCH v6 0/2] Add kernel seccomp support for m68k Michael Schmitz
2021-06-24  0:45 ` [PATCH v6 1/2] m68k/kernel - wire up syscall_trace_enter/leave " Michael Schmitz
2021-06-28  7:25   ` Geert Uytterhoeven
2021-06-28 20:52     ` Michael Schmitz
2021-06-28 22:16     ` Michael Schmitz
2021-06-29  7:31       ` Geert Uytterhoeven
2021-06-29  7:35         ` Greg Ungerer
2021-06-29  7:46           ` Michael Schmitz
2021-06-24  0:46 ` [PATCH v6 2/2] m68k: add kernel seccomp support Michael Schmitz
2021-06-28  7:23   ` Geert Uytterhoeven
2021-06-28 20:17     ` Michael Schmitz [this message]

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=bc56cc50-3270-53d1-d40f-8f69fe1700d7@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-m68k@vger.kernel.org \
    --cc=schwab@linux-m68k.org \
    /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