[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30db1e8e-8eb4-5072-8360-6cafe26db113@solarflare.com>
Date: Mon, 12 Mar 2018 12:02:03 +0000
From: Edward Cree <ecree@...arflare.com>
To: Alexei Starovoitov <ast@...com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>
CC: David Miller <davem@...emloft.net>,
Andy Lutomirski <luto@...capital.net>,
Alexei Starovoitov <ast@...nel.org>,
Djalal Harouni <tixxdz@...il.com>,
Al Viro <viro@...iv.linux.org.uk>,
Daniel Borkmann <daniel@...earbox.net>,
Greg KH <gregkh@...uxfoundation.org>,
"Luis R. Rodriguez" <mcgrof@...nel.org>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
kernel-team <kernel-team@...com>,
Linux API <linux-api@...r.kernel.org>
Subject: Re: [PATCH net-next] modules: allow modprobe load regular elf
binaries
On 09/03/18 18:58, Alexei Starovoitov wrote:
> It's not waiting for the whole thing, because once bpfilter starts it
> stays running/sleeping because it's stateful.
So, this has been bugging me a bit.
If bpfilter takes a signal and crashes, all that state goes away.
Does that mean your iptables/netfilter config just got forgotten and next
time you run iptables it disappears, so you have to re-apply it all again?
> It needs normal
> malloc-ed memory to keep the state of iptable->bpf translation that
> it will use later during subsequent translation calls.
> Theoretically it can use bpf maps pinned in kernel memory to keep
> this state, but then it's non-swappable. It's better to keep bpfilter
> state in its own user memory.
Perhaps the state should live in swappable kernel memory (e.g. a tmpfs
thing, which bpfilter could access through a mount). It'd be read-only
to userspace, listing the existing rules (in untranslated form), and be
updated to reflect the new rule after bpfilter has supplied the updated
translation.
Then bpfilter can cache things if it wants, but the kernel remains the
ultimate arbiter of the state and maintains it over a bpfilter crash.
Sound reasonable?
-Ed
Powered by blists - more mailing lists