From patchwork Thu Aug 19 06:52:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12446429 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 B025AC4338F for ; Thu, 19 Aug 2021 06:54:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7476D610CF for ; Thu, 19 Aug 2021 06:54:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7476D610CF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pUlh7rEXDArG1PWrPTi/7roek7L42NVRlxnR4SceGJk=; b=bwt6HK6D2X+VP6 8eT4zGXk1cpAaiBM84mgBYUUIo1XG28Nb/sTHY2b5DTql+h6sHJOfFiBI0XhPCRJXmde/Pe45hipK 73fhf6yDXM05nH9xbMwhyztcoWS9GxrTy2pX562TMmXtoOYc8wRX7L/BjPYuYjF+xfkjKpeGkaNTb 9i01YfewQExiq72SuNwe7QiUS3boMFvmmcLR9r82aqIll0BC3iUyqAInda2nOtreJ89QEEXdR5Od+ 42WJKMvZGMVTN12Sr4r3HzWO/rjINuqQIdLGlPBiZs2P8MJq5OZyrcb5I2AwagdgkNbznAKvr+WTK /FdiSHak7ziWL6axqlrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGbuh-007NEe-Hk; Thu, 19 Aug 2021 06:52:31 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGbuV-007NCl-Ft for linux-arm-kernel@lists.infradead.org; Thu, 19 Aug 2021 06:52:20 +0000 Received: by mail-pf1-x429.google.com with SMTP id t13so4583268pfl.6 for ; Wed, 18 Aug 2021 23:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S1lq7dkwQtvGOASE5d3elXdTuJ61FzeoaQEdWqV8aoA=; b=H526agwfyZ/NtOClI+SMbMNWxYseIZPQJtMvkG/xDBwGwPVWrAl8B6DVSmhtJplbkL bxNE7cY/XetnsmJsRfpDqRwHKCzefVS+y2SA/C814WAbM0frz4aOVTADCbFeUOv6luK2 0lQjfitesHa+XS457Wvih/1hxD1RvxUH1xGSavbD3U5XZtVTQQQGZDlgSb6JlooiVwk0 dx1ckjrI3teEFK5RHSikmspHYSFJ+3CAWec4ryZW8fXOoWHBRwkXdrxP3tadd8cs9Ca3 uc+FnaOnFMnShgxTYMciK/yAzV93AdOdC/RCbtYunUY2/0ZNUE5FOwiETRrdz0gssU/K lUxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=S1lq7dkwQtvGOASE5d3elXdTuJ61FzeoaQEdWqV8aoA=; b=jw1kIlujMZrxUghq+zLuytRphj3eNW36Z+2/swzeTpESTirGqRO2cjHimSnxxyvux6 rE/OyyOLCT4HIWzd4x5bSTTPbh0U7Bq+JosXBGkxZgaLRGhrmrLcbcR4Bmeu/D4jpWuX NCuVLUIq6nihf1psCrulhVkfxz8PItvZ/QfYoh9X4txaBWgatq2FXDa0cb6sS16VanJ1 xwsjoX/qK/2SsyFwQ7a8YS10psfYe3iLTb0hBWI0er8mxNVczXsNB4AHZAi8qenHEk9O T1Fyavpgd+I0ZCDurRvrLZmM4oz4W4+eWeqn+/RW4SXtMlbl6/kurrXXCgZCBaG6pT0M OA/w== X-Gm-Message-State: AOAM5314a0hOh/6Dr9AsRuw1ch/Tpf7d2CYaoEEeJPISaAAWB38II2Lx 4gvWeAt5nL/3WhTZ9VawmoE= X-Google-Smtp-Source: ABdhPJwQjy4wi+KrWzyzSz9XdaX6KTga5WMJOMryZVdsibsp3KSv6XGkTb+vHinJZwlTtUaOMuCYoQ== X-Received: by 2002:a63:215c:: with SMTP id s28mr12531414pgm.99.1629355938746; Wed, 18 Aug 2021 23:52:18 -0700 (PDT) Received: from localhost.localdomain ([45.124.203.15]) by smtp.gmail.com with ESMTPSA id 4sm1860035pjb.21.2021.08.18.23.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 23:52:17 -0700 (PDT) From: Joel Stanley To: Andrew Jeffery Cc: linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: [PATCH 1/4] ARM: config: aspeed: Enable hardened allocator feature Date: Thu, 19 Aug 2021 16:22:00 +0930 Message-Id: <20210819065203.2620911-2-joel@jms.id.au> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210819065203.2620911-1-joel@jms.id.au> References: <20210819065203.2620911-1-joel@jms.id.au> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210818_235219_570075_1879792E X-CRM114-Status: GOOD ( 14.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org SLAB_FREELIST_HARDENED can protect from freelist overwrite attacks with really small overhead. It works best with the SLUB allocator, so make SLUB the default by removing SLAB=y. total used free shared buff/cache available SLAB 425596 44065.3+/-220 311099+/-3800 14864+/-3900 70432+/-3700 352767+/-3900 SLUB 425592 44225.3+/-280 313275+/-600 12132+/-3.3 68092+/-530 355295+/-280 These figures are the average memory usage from three boots of each option in qemu, running the Romulus userspace. The output is from free(1), reported in kilobytes. Signed-off-by: Joel Stanley --- arch/arm/configs/aspeed_g4_defconfig | 2 +- arch/arm/configs/aspeed_g5_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig index a3ee647b1ebb..397c57e94743 100644 --- a/arch/arm/configs/aspeed_g4_defconfig +++ b/arch/arm/configs/aspeed_g4_defconfig @@ -18,8 +18,8 @@ CONFIG_BPF_SYSCALL=y CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set -CONFIG_SLAB=y CONFIG_SLAB_FREELIST_RANDOM=y +CONFIG_SLAB_FREELIST_HARDENED=y # CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_ASPEED=y CONFIG_MACH_ASPEED_G4=y diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/aspeed_g5_defconfig index 2db48438c5d2..3f81146a9c0e 100644 --- a/arch/arm/configs/aspeed_g5_defconfig +++ b/arch/arm/configs/aspeed_g5_defconfig @@ -18,8 +18,8 @@ CONFIG_BPF_SYSCALL=y CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set -CONFIG_SLAB=y CONFIG_SLAB_FREELIST_RANDOM=y +CONFIG_SLAB_FREELIST_HARDENED=y CONFIG_ARCH_MULTI_V6=y CONFIG_ARCH_ASPEED=y CONFIG_MACH_ASPEED_G5=y