From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-f65.google.com ([209.85.210.65]:38453 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbeJMB52 (ORCPT ); Fri, 12 Oct 2018 21:57:28 -0400 Received: by mail-ot1-f65.google.com with SMTP id l1so13240171otj.5 for ; Fri, 12 Oct 2018 11:23:41 -0700 (PDT) MIME-Version: 1.0 References: <20181011233117.7883-1-rick.p.edgecombe@intel.com> <20181011233117.7883-2-rick.p.edgecombe@intel.com> In-Reply-To: From: Jann Horn Date: Fri, 12 Oct 2018 20:23:15 +0200 Message-ID: Subject: Re: [PATCH v2 1/7] modules: Create rlimit for module space To: rick.p.edgecombe@intel.com Cc: Kernel Hardening , Daniel Borkmann , Kees Cook , Catalin Marinas , Will Deacon , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "the arch/x86 maintainers" , Arnd Bergmann , jeyu@kernel.org, linux-arm-kernel@lists.infradead.org, kernel list , linux-mips@linux-mips.org, linux-s390 , sparclinux@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch , kristen@linux.intel.com, Dave Hansen , Arjan van de Ven , deneen.t.dock@intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Oct 12, 2018 at 2:35 AM Jann Horn wrote: > On Fri, Oct 12, 2018 at 1:40 AM Rick Edgecombe > wrote: > > This introduces a new rlimit, RLIMIT_MODSPACE, which limits the amount of > > module space a user can use. The intention is to be able to limit module space > > allocations that may come from un-privlidged users inserting e/BPF filters. > > Note that in some configurations (iirc e.g. the default Ubuntu > config), normal users can use the subuid mechanism (the /etc/subuid > config file and the /usr/bin/newuidmap setuid helper) to gain access > to 65536 UIDs, which means that in such a configuration, > RLIMIT_MODSPACE*65537 is the actual limit for one user. (Same thing > applies to RLIMIT_MEMLOCK.) Actually, I may have misremembered, perhaps it's not installed by default - I just checked in a Ubuntu VM, and the newuidmap helper from the uidmap package wasn't installed.