public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Howard McLauchlan <hmclauchlan@fb.com>
To: Andy Lutomirski <luto@kernel.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux API <linux-api@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>, Yonghong Song <yhs@fb.com>,
	"David S . Miller" <davem@davemloft.net>,
	Thomas Garnier <thgarnie@google.com>,
	kernel-team <kernel-team@fb.com>
Subject: Re: [PATCH] bpf: whitelist syscalls for error injection
Date: Mon, 19 Mar 2018 12:18:51 -0700	[thread overview]
Message-ID: <831eeeae-ecfe-efca-79a2-8edd50adc668@fb.com> (raw)
In-Reply-To: <CALCETrWU4KDu+3U2Z6XpLcV5G9-ihesCdREdaGtO76spuHW-mA@mail.gmail.com>

On 03/18/2018 07:13 PM, Andy Lutomirski wrote:
> On Sun, Mar 18, 2018 at 6:47 AM, Dominik Brodowski
> <linux@dominikbrodowski.net> wrote:
>> On Fri, Mar 16, 2018 at 03:55:04PM -0700, Howard McLauchlan wrote:
>>> On 03/13/2018 04:56 PM, Andy Lutomirski wrote:
>>>> On Tue, Mar 13, 2018 at 11:16 PM, Howard McLauchlan <hmclauchlan@fb.com> wrote:
>>>>> Error injection is a useful mechanism to fail arbitrary kernel
>>>>> functions. However, it is often hard to guarantee an error propagates
>>>>> appropriately to user space programs. By injecting into syscalls, we can
>>>>> return arbitrary values to user space directly; this increases
>>>>> flexibility and robustness in testing, allowing us to test user space
>>>>> error paths effectively.
>>>>
>>>> Temporary NAK IMO.  Specifically:
>>>>
>>>>> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
>>>>> index a78186d826d7..e8c6d63ace78 100644
>>>>> --- a/include/linux/syscalls.h
>>>>> +++ b/include/linux/syscalls.h
>>>>> @@ -191,6 +191,8 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
>>>>>
>>>>>  #define SYSCALL_DEFINE0(sname)                                 \
>>>>>         SYSCALL_METADATA(_##sname, 0);                          \
>>>>> +       asmlinkage long sys_##sname(void);                      \
>>>>> +       ALLOW_ERROR_INJECTION(sys_##sname, ERRNO);              \
>>>>
>>>> sys_xyz() is not just the syscall itself; it's also a helper that's
>>>> used for entirely silly reasons by various bits of kernel code for
>>>> quite a few syscalls.  Fortunately, Dominik has patches to fix that,
>>>> and Linus is even considering pulling them for 4.16.  This patch will
>>>> most likely conflict with the final result of Dominik's series.
>>>>
>>>> Can you and Dominik coordinate a bit to get this patch or its
>>>> equivalent landed on top of Dominik's work?  It might make sense for
>>>> Dominik to just add this patch to his series so it can land with the
>>>> rest of it.  Dominik, Ingo, what do you think?
>>>>
>>>> --Andy
>>>>
>>>
>>> Dominik,
>>>
>>> This patch applies cleanly on top of your patch series. Is there anything you'd need from me to get this in on top of your work?
>>
>> Howard,
>>
>> would this form part of the kernel<->userspace interface and therefore needs
>> to be kept stable? If so, this patch should wait until the arch-specific
>> syscall calling convention is agreed upon.
>>
>> Moreover, the patches I sent out already do not cover all syscalls yet.
>> Until all in-kernel users of sys_*() are gone (or at least outside arch/),
>> I'd prefer to postpone this patch.
>>
> 
> I was assuming that this ALLOW_ERROR_INJECTION thing is *not*
> considered stable ABI.  We should be free to change the way that the
> syscall entry code calls syscalls whenever we like.
> 
> If you want a stable syscall error injection mechanism, make it work
> like seccomp instead, please.
> 

This is not supposed to be considered stable. It's for debug purposes only and 
would normally be configured off.

Howard

      reply	other threads:[~2018-03-19 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 23:16 [PATCH] bpf: whitelist syscalls for error injection Howard McLauchlan
2018-03-13 23:45 ` Omar Sandoval
2018-03-13 23:49   ` Yonghong Song
2018-03-14  0:00     ` Howard McLauchlan
2018-03-13 23:56 ` Andy Lutomirski
2018-03-16 22:55   ` Howard McLauchlan
2018-03-18  6:47     ` Dominik Brodowski
2018-03-19  2:13       ` Andy Lutomirski
2018-03-19 19:18         ` Howard McLauchlan [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=831eeeae-ecfe-efca-79a2-8edd50adc668@fb.com \
    --to=hmclauchlan@fb.com \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yhs@fb.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