Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp60577pxk; Mon, 5 Oct 2020 17:47:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWDE15xF67AfMLqzrM1ntKfmgElmmtxJXcpbgQ1fUtOxYybWHdis4CVs91SZaj3/waB7bf X-Received: by 2002:a50:bc01:: with SMTP id j1mr2696656edh.66.1601945237288; Mon, 05 Oct 2020 17:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601945237; cv=none; d=google.com; s=arc-20160816; b=n789l9a8FAsv1tvALdHhYlrzjjdpfcqAaiT02ophLc3KKwA6Xj4xXKialmUTlg0e0s fLLpQJKbPrL9moDWRlViAR2QRlrvbFCevqlp1I0nq98Px3qPxu2pYX0390LcxrePArWV MdYLXeU51dnbcDqJ05SGOlYsGGnSZLjaZitDBDnWzc/Ag8QAPeY4jdiA3ZJ/zsbO3o5l 5sMEFwP3V2sv6rC2aSg7GhcByIHVrG1jRaZ8+4EOWnh56j6Y3dXRkZLLiu2f7vo/ngWC 4vJ4qF+s8xaD/qcu0Ilw4gvUy7vvsS368iKJOQEd4AhxkL9YgBZuY4GV+3S82aZtM+LX kjxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d7VSZPo044cxIxYzl44q0fNIFgW7c06/GV69ntJURIg=; b=UCV+aZCdBgRs9OCPWGFKi6FIcnR3g4UvUCt9Ymf07WSg4luhCBAMkKwgswK/IBPn5u RtuxbCoVvhF9qYjep7jtHWkY/ZZxKtXi6p1hkWgp1EoXOdb77S6QD8XSXFZcS2abICYU f5CbyIQYjVXjFjYu6SiNFgb3dvo3SVwVSn0i6fmzUtjg5TwOy1E6jctUf+/xcXJkRICY zfNTeRggjDdwKqdHIEVIhnIhmBeUqugP6+0tYOgNMRCjocsuQJTj0M8O/yuQqLo/ztlb ssiADRNHuBc2Ukwi9pINf+frgE9i2bSpQQ1qBxvhq/oT1r0GunzQcci0xAyxOb8ygvpl 7cUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Onk4Nn05; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si1143715eds.558.2020.10.05.17.46.55; Mon, 05 Oct 2020 17:47:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Onk4Nn05; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726576AbgJFApO (ORCPT + 99 others); Mon, 5 Oct 2020 20:45:14 -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 ...