From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH net-next] modules: allow modprobe load regular elf binaries Date: Fri, 9 Mar 2018 10:53:45 -0800 Message-ID: References: <20180306013457.1955486-1-ast@kernel.org> <87478c51-59a7-f6ac-1fb2-f3ca2dcf658b@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: Alexei Starovoitov , Kees Cook , Alexei Starovoitov , Djalal Harouni , Al Viro , "David S. Miller" , Daniel Borkmann , Greg KH , "Luis R. Rodriguez" , Network Development , LKML , kernel-team , Linux API List-Id: linux-api@vger.kernel.org On Fri, Mar 9, 2018 at 10:48 AM, Andy Lutomirski wrot= e: >> On Mar 9, 2018, at 10:17 AM, Linus Torvalds wrote: >> >> Hmm. I wish we had an "execute blob" model, but we really don't, and >> it would be hard/impossible to do without pinning the pages in memory. >> > > Why so hard? We can already execute a struct file for execveat, and Alex= ei already has this working for umh. > Surely we can make an immutable (as in even root can=E2=80=99t write it) = kernel-internal tmpfs file, execveat it, then unlink it. And what do you think that does? It pins the memory for the whole time. As a *copy* of the original file. Anyway, see my other suggestion that makes this all irrelevant. Just wait synchronously (until the exit), and just use deny_write_access(). The "synchronous wait" means that you don't have the semantic change (and really., it's *required* anyway for the whole mutual exclusion against another thread racing to load the same module), and the deny_write_access() means that we don't neeed to make another copy. Linus