Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2658894pxa; Mon, 17 Aug 2020 15:46:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKbOmyYvFcLiDOI2lI8XxlBCt5WsohEst/hiaxyj40OTcpD1WKEf2RYp8/JqXcr62yrDWb X-Received: by 2002:a17:906:d187:: with SMTP id c7mr17714898ejz.196.1597704368997; Mon, 17 Aug 2020 15:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704368; cv=none; d=google.com; s=arc-20160816; b=zjvZ+te7EDJrRlU1OXM0rUiiv5aM3SeXMb4MsN+IHLIvJnS+GrojEjGoOKcQTRuewE +USjfh448G9FvVh4biKo9gcYJd6z5DVJKi6Fy+TJ8WNvGj5Z2Jy8EBziAzmIuncO0aYz dBtUfpZCrHeZDcaUDFPzF0GU4J/+7yMLbImjyZjxBIDvzpateBJh1Lt+FDdwyCXpQ9+M pUg5yrgnaQ0eHTLy9hczLf+oVy0TFZoxgaK9oYRWSVMGjnGUcjy5sG8scytYH4Uj/RXz /N/ohe0gkxSvwZR9968FYv6uYPhhKZ13quEfRy296bfY1PPF2rZ+kR/Ute/gCE3Ii3He Dj8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=n32LWoSrsD3yQ3rMPfKnibY9bI4SixyCGhqWBe/ljHM=; b=qcu2F2XzLBGCK7NeFX7TrIeiKYRzZVyXuL5wubyMwuPY+RVMdkjcDWNxPHEiqP5PPg 0cHbnBvdEhQJ9qMt02wfUFeqyWrVc1o1CWluMSVjapQ6DCfSCOSQU4yc/dt+8SLj46vg jG4n3hU7bzgvLEzVyGOSlayjnjJRDapcdJA/PDlXJAwdq0K48TFJGAtf8HeGvPaDp+Ej yQsITl1PeXxLCMdHwNgck5fjIwaFOidN2/7dcbBf0L5E9BXRWxD8zJmegUw3PHGzIDBP uA12ve4tD+6L8wU78h2YW9uO+MN1DZX30hfH8yThCvKSjU5oLIbTmyHkjHnaXP5s2Z5g f0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kl0qMavr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si12088767ejo.749.2020.08.17.15.45.46; Mon, 17 Aug 2020 15:46:08 -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=@chromium.org header.s=google header.b=kl0qMavr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731984AbgHQTYn (ORCPT + 99 others); Mon, 17 Aug 2020 15:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731970AbgHQTYc (ORCPT ); Mon, 17 Aug 2020 15:24:32 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C761CC061389 for ; Mon, 17 Aug 2020 12:24:31 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id i10so3039061pgk.1 for ; Mon, 17 Aug 2020 12:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=n32LWoSrsD3yQ3rMPfKnibY9bI4SixyCGhqWBe/ljHM=; b=kl0qMavriKg0e81CBNLz0jae/dnxJ+iW38gvYVPjCqfQaZ+mAYzLkbyiP+bHcdJX/r 4GaLIsElPRD0nX/WfT98jtJoPe7Y1PB20/5qoA4l7Luu2OOw/7Cf7PPJ1w11WT14NtFQ 1t42W+NHFHCPaxa6F7e5H3S27ECjJwNGgvJrg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=n32LWoSrsD3yQ3rMPfKnibY9bI4SixyCGhqWBe/ljHM=; b=R2IDjt/H0jr6731qKtiT3GqJNAPJWz44ItDDEXGSITpjgJNgVmW6O6dgof+Wlt+xCc uKM0zM60OMJU/xg0nAUHl0IXH8606FWJAXdIXz9zCMsfaGz25FZzvh7S9OW3d+YVE/qE 4IWSoyZ26gPW61CysO9bbjElo5ZMX94SR90gcR0MsGIP/JyIjVYUiuFMb+jjX3hBNZWg twSBiwbbFULmWdTaUwc+hBxOEJ/TeO4fC15LXSgQZEbk0UI/n9RLuMVOA9R7w14EgXZm hlFrQk/JBvx7JpjjJCd7NGzSMILOrJpLZloAVdPOqFl9eAVXlA9sEnrN7g8SY2ExlkAo hnVA== X-Gm-Message-State: AOAM5301CSSP8soVWzgVL5uPMte/GE6ehdUkxGRw1tS8a2BlPp/xmqVx FAIos6oc7r98cHj76FAXgl2DRA== X-Received: by 2002:a62:928d:: with SMTP id o135mr9014150pfd.22.1597692271280; Mon, 17 Aug 2020 12:24:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i1sm21321974pfo.212.2020.08.17.12.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 12:24:30 -0700 (PDT) Date: Mon, 17 Aug 2020 12:24:29 -0700 From: Kees Cook To: "Eric W. Biederman" Cc: Alexander Popov , 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 , 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, Kexec Mailing List Subject: Re: [PATCH RFC 2/2] lkdtm: Add heap spraying test Message-ID: <202008171222.3F206231E@keescook> References: <20200813151922.1093791-1-alex.popov@linux.com> <20200813151922.1093791-3-alex.popov@linux.com> <87zh6t9llm.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zh6t9llm.fsf@x220.int.ebiederm.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 17, 2020 at 01:24:37PM -0500, Eric W. Biederman wrote: > Alexander Popov writes: > > > Add a simple test for CONFIG_SLAB_QUARANTINE. > > > > It performs heap spraying that aims to reallocate the recently freed heap > > object. This technique is used for exploiting use-after-free > > vulnerabilities in the kernel code. > > > > This test shows that CONFIG_SLAB_QUARANTINE breaks heap spraying > > exploitation technique. > > > > Signed-off-by: Alexander Popov > > Why put this test in the linux kernel dump test module? > > I have no problem with tests, and I may be wrong but this > does not look like you are testing to see if heap corruption > triggers a crash dump. Which is what the rest of the tests > in lkdtm are about. Seeing if the test triggers successfully > triggers a crash dump. The scope of LKDTM has shifted a bit, and I'm fine with tests that don't cause crashes as long as they're part of testing system-wide defenses, etc. It's easier to collect similar tests together (even if they don't break the system). -- Kees Cook