[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6135f2c-bc8f-41c3-9c6a-8346d685e4dc@intel.com>
Date: Thu, 22 Feb 2024 07:51:00 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Petr Tesarik <petrtesarik@...weicloud.com>
Cc: Petr Tesařík <petr@...arici.cz>,
Jonathan Corbet <corbet@....net>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Andy Lutomirski <luto@...nel.org>,
Oleg Nesterov <oleg@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Xin Li <xin3.li@...el.com>, Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Kees Cook <keescook@...omium.org>,
"Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
Pengfei Xu <pengfei.xu@...el.com>, Josh Poimboeuf <jpoimboe@...nel.org>,
Ze Gao <zegao2021@...il.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Kai Huang <kai.huang@...el.com>, David Woodhouse <dwmw@...zon.co.uk>,
Brian Gerst <brgerst@...il.com>, Jason Gunthorpe <jgg@...pe.ca>,
Joerg Roedel <jroedel@...e.de>, "Mike Rapoport (IBM)" <rppt@...nel.org>,
Tina Zhang <tina.zhang@...el.com>, Jacob Pan
<jacob.jun.pan@...ux.intel.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
Roberto Sassu <roberto.sassu@...weicloud.com>,
John Johansen <john.johansen@...onical.com>, Paul Moore
<paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>, apparmor@...ts.ubuntu.com,
linux-security-module@...r.kernel.org,
Petr Tesarik <petr.tesarik1@...wei-partners.com>
Subject: Re: [RFC 4/5] sbm: fix up calls to dynamic memory allocators
On 2/22/24 05:12, Petr Tesarik wrote:
> static const struct sbm_fixup fixups[] =
> {
> + /* kmalloc() and friends */
> + { kmalloc_trace, proxy_alloc3 },
> + { __kmalloc, proxy_alloc1 },
> + { __kmalloc_node, proxy_alloc1 },
> + { __kmalloc_node_track_caller, proxy_alloc1 },
> + { kmalloc_large, proxy_alloc1 },
> + { kmalloc_large_node, proxy_alloc1 },
> + { krealloc, proxy_alloc2 },
> + { kfree, proxy_free },
> +
> + /* vmalloc() and friends */
> + { vmalloc, proxy_alloc1 },
> + { __vmalloc, proxy_alloc1 },
> + { __vmalloc_node, proxy_alloc1 },
> + { vzalloc, proxy_alloc1 },
> + { vfree, proxy_free },
> +
> { }
> };
Petr, thanks for sending this. This _is_ a pretty concise example of
what it means to convert kernel code to run in your sandbox mode. But,
from me, it's still "no thanks".
Establishing and maintaining this proxy list will be painful. Folks
will change the code to call something new and break this *constantly*.
That goes for infrastructure like the allocators and for individual
sandbox instances like apparmor.
It's also telling that sandboxing a bit of apparmor took four fixups.
That tells me we're probably still only looking at the tip of the icebeg
if we were to convert a bunch more sites.
That's on top of everything I was concerned about before.
Powered by blists - more mailing lists