Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2011 19:57:25 +0400
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        Pawel Tyll <ptyll@nitronet.pl>, Adrian Chadd <adrian@freebsd.org>, Lev Serebryakov <lev@freebsd.org>, "Alexander V. Chernikov" <melifaro@freebsd.org>, Mike Tancsa <mike@sentex.net>, freebsd-net@freebsd.org, freebsd-ipfw@freebsd.org
Subject:   Re: Firewall Profiling.
Message-ID:  <1742895255.20111228195725@serebryakov.spb.ru>
In-Reply-To: <20111228104251.GB74183@onelab2.iet.unipi.it>
References:  <1498545030.20111227015431@nitronet.pl> <4EF9ADBC.8090402@FreeBSD.org> <4EFA3F6F.9040404@sentex.net> <4EFA40D7.60206@FreeBSD.org> <CAJ-Vmo=XL2%2BMSV%2BBYCy6QpQ9Q%2Bo9=qCajQezDaMo%2BJ96CoRbkQ@mail.gmail.com> <444957640.20111228102844@serebryakov.spb.ru> <20111228104251.GB74183@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello, Luigi.
You wrote 28 =E4=E5=EA=E0=E1=F0=FF 2011 =E3., 14:42:51:

> There is a problem here. You have to trust the native code
> before allowing its execution in the kernel. So either you
  root could load any KLD. So, I think, we could trust any code
"uploaded" via setsocopt()... Yes, it looks dangerous, but, again, if
root is compromised, attacker could compile and load kernel module as
well.

> implement some form of sandboxing or code validator
> before accepting a blob of native code from the setsockopt(),
> or you generate the code directly within the kernel.
> But with these sizes you cannot embed clang or gcc in the kernel:
  clang is bad example, it needs to process C/C++ code (frontend).
  Custom-written compiler with LLVM as backend could have very
  reasonable size. But not for kernel side, for sure, in any case!

> though i would guess that a custom code generator is probably simpler
> to write (perhaps reusing sys/i386/i386/bpf_jit_machdep.c and its
> amd64 counterpart)
  Yep, as we have BPF JIT, it could be simpler.

--=20
// Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1742895255.20111228195725>