Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1870447pxa; Sun, 16 Aug 2020 14:15:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEBd6y7/LdNGjyORqWFNPXOtjosZJ5gHkyApavt1VqxqarEZqi7p+X9yFB1fkBcVV31ln9 X-Received: by 2002:a17:906:a3d9:: with SMTP id ca25mr12384550ejb.164.1597612558963; Sun, 16 Aug 2020 14:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597612558; cv=none; d=google.com; s=arc-20160816; b=SYa3OaH6SLlmxp54mYmg4PYvJwiTi4SoUeVUfxrY5yKXKKEEm9Ffwhd0G2qbigKXhG rFA0vZPpOTgmIwlV6S09+ztX6w8Qj5RTUOGVD6BN65HabfEZzUrUdFI2qxKUg9jOCI73 gwNc5MG4LPnN+WiRHpLdxFgbzS6n5hSgppXWwCUMJ2NsCie8vYo3u4WILWyTqo3si8sF UJ84Q6i6KB9iJy+lQ1s0j0hwXWGXAVdTv75L7fEXolmuJO0BXNS73cf8IPtrZRPFrGDt dvVg6aenQOIr1LhuSnK2BLYJ8e3p6J5ojVx5XvjlgJzw3lQorMYQ0/ZGXa63JcrXX9wy 7a7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jE/Jl64BOvgj9LP7xJg6xC/9wBN72Wf035OYAvVL8lM=; b=FyvqMTV7c/eX6WFchMZrYs11jM/r1q3HbpMzRAzlFarGwjTLn2LRjQVBhgYorw1Eap dWIIuSrEVN2gfA2+dOznftuuyf52xPum6TGERnW7ArIspuEb2eECjZa5qfc3YgfIsONz 6V1BMU3Lwo9AACvIladYnlJQxoYASpwQPz4p/Gt86gA8FhcV8kXTQBzuSsUiWCSvj6Pl sbITNi0voePzYIVD1/OmWmAuqANI02LIVtzeY7FivQGR0gcpH/Scqy7VCKPI6oDAm6ya lsUDp7E2PRzxizfLMp8PnJ+7xeJR5K58GiNuGuS1COq4ndvolknybFgD5H2u2R1oaX3Z KIWw== 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 i2si9819044ejg.240.2020.08.16.14.15.34; Sun, 16 Aug 2020 14:15:58 -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 S1729313AbgHPT7d (ORCPT + 99 others); Sun, 16 Aug 2020 15:59:33 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:33412 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729117AbgHPT7d (ORCPT ); Sun, 16 Aug 2020 15:59:33 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 4D4C71C0BB6; Sun, 16 Aug 2020 21:59:31 +0200 (CEST) Date: Sun, 16 Aug 2020 21:59:30 +0200 From: Pavel Machek To: Matthew Wilcox Cc: Alexander Popov , Kees Cook , Jann Horn , 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 , kasan-dev@googlegroups.com, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, notify@kernel.org Subject: Re: [PATCH RFC 1/2] mm: Extract SLAB_QUARANTINE from KASAN Message-ID: <20200816195930.GA4155@amd> References: <20200813151922.1093791-1-alex.popov@linux.com> <20200813151922.1093791-2-alex.popov@linux.com> <20200815185455.GB17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20200815185455.GB17456@casper.infradead.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat 2020-08-15 19:54:55, Matthew Wilcox wrote: > On Thu, Aug 13, 2020 at 06:19:21PM +0300, Alexander Popov wrote: > > +config SLAB_QUARANTINE > > + bool "Enable slab freelist quarantine" > > + depends on !KASAN && (SLAB || SLUB) > > + help > > + Enable slab freelist quarantine to break heap spraying technique > > + used for exploiting use-after-free vulnerabilities in the kernel > > + code. If this feature is enabled, freed allocations are stored > > + in the quarantine and can't be instantly reallocated and > > + overwritten by the exploit performing heap spraying. > > + This feature is a part of KASAN functionality. >=20 > After this patch, it isn't part of KASAN any more ;-) >=20 > The way this is written is a bit too low level. Let's write it in terms > that people who don't know the guts of the slab allocator or security > terminology can understand: >=20 > Delay reuse of freed slab objects. This makes some security > exploits harder to execute. It reduces performance slightly > as objects will be cache cold by the time they are reallocated, > and it costs a small amount of memory. Written this way, it invites questions: Does it introduce any new deadlocks in near out-of-memory situations? Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl85kCIACgkQMOfwapXb+vLxYwCfbn811vr0Zj6oofab9u8xfms5 WYIAnjboCM2RGhT/UoknoFiLV5GpOKEC =c5uZ -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--