Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp99515pxu; Tue, 6 Oct 2020 01:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIGop7v6K2G4F2DJzaIRpC/2EQHxLaIOwy/O9RziNCN/VodseDT5npKALkJ8BIAJ+03P7X X-Received: by 2002:a17:906:a101:: with SMTP id t1mr3819240ejy.203.1601973266896; Tue, 06 Oct 2020 01:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601973266; cv=none; d=google.com; s=arc-20160816; b=ySGL4/mfetBfytRFj4K6mopqBMTucOTTQbkUAd6MovfmVE0+Ajfl5Oz/T4jJS92j5K eIlk4qLkiMikqUMq0bWc+8dKxlYiDuSsTNY+Ye1X7tjQEORGHkycu/AIOUuncn/uxke7 1hUJJMfP6f/zMHGksaBds9K1l5yPQE21hTnAMsIQ+7M9AXikX/F6BDAbZKGCiZJkIFVz gWMRUADID/OgggRF6r9bMMhZsl5++hVL7UCRoaRdRIPpoGoH5xIFL/XoKZva1Pr1ACwp WS847VE7f1qzLipb/UcocpOuAD9N+Xf7BsMg0nhX2nX5b+FTBbrLU5edqyXWfmd0HgFn I+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=h2fGi82oNeDwbuAxdUUFtC85weVXxwx+kW762dleTbQ=; b=FKr5Bp2mEHmSM7/IxrzKgCiYsPUpqGZztSSn9zWkekyWxVeFX5QtHKzr5OHmtm9XV+ QFcYrarc35tvvui52iLLc/VWLKeG3iF9XAX+pMZqkoxTbgEmUQG7IRxILjEpupnc/2ZZ lhtkr9v+DmoDTXk3dQVEOvOTERCLZmouDKphH8ijm8ldMUOOnvPl0uGcIIAI5aGTmJK2 oHYIUgmkt5SdQT14ezmaAxbnJdfdR7EiwszAZAki5x0wyWZbF6vYs/b6Kbyq6iJDGBED 4+EC0IygbQ2+J5BUMuXd7V39XljGXK+PDJRiiPMSVeJf0484+THjgnueZ9XM89JK9SuV 1QbA== ARC-Authentication-Results: i=1; mx.google.com; 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 si11si1383106ejb.693.2020.10.06.01.34.04; Tue, 06 Oct 2020 01:34:26 -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; 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 S1726133AbgJFIcx (ORCPT + 99 others); Tue, 6 Oct 2020 04:32:53 -0400 Received: from gentwo.org ([3.19.106.255]:50294 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgJFIcx (ORCPT ); Tue, 6 Oct 2020 04:32:53 -0400 Received: by gentwo.org (Postfix, from userid 1002) id 2990640ABD; Tue, 6 Oct 2020 08:32:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 26F2140ABC; Tue, 6 Oct 2020 08:32:52 +0000 (UTC) Date: Tue, 6 Oct 2020 08:32:52 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Matthew Wilcox cc: Jann Horn , Alexander Popov , Kees Cook , Will Deacon , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , 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 In-Reply-To: <20201006004414.GP20115@casper.infradead.org> Message-ID: References: <20200929183513.380760-1-alex.popov@linux.com> <91d564a6-9000-b4c5-15fd-8774b06f5ab0@linux.com> <20201006004414.GP20115@casper.infradead.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 6 Oct 2020, Matthew Wilcox wrote: > 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 ... TYPESAFE functionality switches a lot of debugging off because that also allows speculative accesses to the object after it was freed (requires for RCU safeness because the object may be freed in an RCU period where it is still accessed). I do not think you would like that.