From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B455C4363D for ; Tue, 6 Oct 2020 00:45:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44F2A207F7 for ; Tue, 6 Oct 2020 00:45:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Onk4Nn05" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726629AbgJFApP (ORCPT ); Mon, 5 Oct 2020 20:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbgJFApO (ORCPT ); Mon, 5 Oct 2020 20:45:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C421C0613A7 for ; Mon, 5 Oct 2020 17:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=d7VSZPo044cxIxYzl44q0fNIFgW7c06/GV69ntJURIg=; b=Onk4Nn051IJxw0teFwDsjobrty /hDTEB5jMbF5zBhq7h/fTlEWFJuJQ6/DHdsGOawLRI/mo45t/zac/xr4OyiDc76laFKIS0VcEk+BH SYq4Tv0ANxtWGY1KTbNyqsfTQziZajI6DqMlSm0N/V0L2VBSrD7SuPaL+CNX9V22YQ4Q195wh6ypm 7pCUi+ZoSePY0B1pgMOPGSsQz+I/sPpsHlAsHf2pn9SWMi9v5eMFuQ7aUilqpusQHg3NA00dc5td0 VN8c8EYbPTr4LFm0wS44cWMhoPLdMg9s4QKWZQkMTSY0VZHbIm8nzywpx6/5N6wVmCH3IKoyT03BA WqxfoMhA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPb5S-00007d-KE; Tue, 06 Oct 2020 00:44:14 +0000 Date: Tue, 6 Oct 2020 01:44:14 +0100 From: Matthew Wilcox To: Jann Horn Cc: Alexander Popov , Kees Cook , Will Deacon , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Masahiro Yamada , Masami Hiramatsu , Steven Rostedt , Peter Zijlstra , Krzysztof Kozlowski , Patrick Bellasi , David Howells , Eric Biederman , Johannes Weiner , Laura Abbott , Arnd Bergmann , Greg Kroah-Hartman , Daniel Micay , Andrey Konovalov , Pavel Machek , Valentin Schneider , kasan-dev , Linux-MM , Kernel Hardening , kernel list , notify@kernel.org Subject: Re: [PATCH RFC v2 0/6] Break heap spraying needed for exploiting use-after-free Message-ID: <20201006004414.GP20115@casper.infradead.org> References: <20200929183513.380760-1-alex.popov@linux.com> <91d564a6-9000-b4c5-15fd-8774b06f5ab0@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2020 at 12:56:33AM +0200, Jann Horn wrote: > It seems to me like, if you want to make UAF exploitation harder at > the heap allocator layer, you could do somewhat more effective things > with a probably much smaller performance budget. Things like > preventing the reallocation of virtual kernel addresses with different > types, such that an attacker can only replace a UAF object with > another object of the same type. (That is not an idea I like very much > either, but I would like it more than this proposal.) (E.g. some > browsers implement things along those lines, I believe.) The slab allocator already has that functionality. We call it TYPESAFE_BY_RCU, but if forcing that on by default would enhance security by a measurable amount, it wouldn't be a terribly hard sell ...