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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Dec 2022 08:58:55 -0800
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Chris Mason <clm@...a.com>, Steven Rostedt <rostedt@...dmis.org>,
        Borislav Petkov <bp@...en8.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Kees Cook <keescook@...omium.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        KP Singh <kpsingh@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Florent Revest <revest@...omium.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Christoph Hellwig <hch@...radead.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>
Subject: Re: [PATCH] error-injection: Add prompt for function error injection

On Wed, Nov 30, 2022 at 2:37 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Tue, 22 Nov 2022 14:51:08 -0500 Chris Mason <clm@...a.com> wrote:
>
> > On 11/22/22 1:29 PM, Steven Rostedt wrote:
> > > On Tue, 22 Nov 2022 12:42:33 -0500
> > > Chris Mason <clm@...a.com> wrote:
> > >
> > >> On 11/22/22 5:39 AM, Borislav Petkov wrote:
> > >>> On Mon, Nov 21, 2022 at 03:36:08PM -0800, Alexei Starovoitov wrote:
> > >>>> The commit log is bogus and the lack of understanding what
>
> Why am I not understanding the controversy here?  With this patch
> applied, people who want function error injection enable
> CONFIG_FUNCTION_ERROR_INJECTION and people who don't want it don't do
> that.
>
> Alexei, can you please suggest a less bogus changelog for this?

People are using ALLOW_ERROR_INJECTION to allowlist kernel functions
where bpf progs can attach.
For example in the linux-next:
git grep ALLOW_ERROR_INJECTION
drivers/hid/bpf/hid_bpf_dispatch.c:ALLOW_ERROR_INJECTION(hid_bpf_device_event,
ERRNO);
drivers/hid/bpf/hid_bpf_dispatch.c:ALLOW_ERROR_INJECTION(hid_bpf_rdesc_fixup,
ERRNO);
drivers/hid/bpf/hid_bpf_jmp_table.c:ALLOW_ERROR_INJECTION(__hid_bpf_tail_call,
ERRNO);

The hid-bpf framework depends on it.
iirc Benjamin mentioned that chromeos is one of the future users
of hid-bpf. They need it to deal with a variety of quirks in hid
devices in production.

Either hid-bpf or bpf core can add
"depends on FUNCTION_ERROR_INJECTION"
to its kconfig.
Like:
diff --git a/kernel/bpf/Kconfig b/kernel/bpf/Kconfig
index 2dfe1079f772..281e5263f3d1 100644
--- a/kernel/bpf/Kconfig
+++ b/kernel/bpf/Kconfig
@@ -32,6 +32,7 @@ config BPF_SYSCALL
        select BINARY_PRINTF
        select NET_SOCK_MSG if NET
        select PAGE_POOL if NET
+       depends on FUNCTION_ERROR_INJECTION
        default n

but the better option for now would be to drop this patch.
For the next next merge window we can come up with alternative way
(instead of ALLOW_ERROR_INJECTION) to mark kernel functions
purely on the bpf side.
I don't think we have time to add this marking infrastructure
for the upcoming merge window.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ