Message ID | 20180105090212.GA4026@pjb1027-Latitude-E5410 (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B358601A1 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 5 Jan 2018 09:02:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 938712882E for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 5 Jan 2018 09:02:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88298288B4; Fri, 5 Jan 2018 09:02:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1AE782882E for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 5 Jan 2018 09:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZU1LkpHnLK3gdc/S7C9dOk72h0Q3iWPIOeNLxY8a2O8=; b=Q7YLK+lc2qCc10 Iym8Wxs07rnouiDkJI0KET1lIYTP5+QvYexCPFOZ+ss2qcgPp7FNbFhk3H59VkUNyqGS7LfZjSfR7 fgso+403thV01ofAvZIBlg3E/yI8oyBmDHjpyynhahppmIGr9N4cq10Bg4ySuMbXeF3HedqY1VXDE ctMKEJZ76fxaYw1tBLDkM7X6PSyAbZJZYwTeze8vdKmW/UcjaZB6Ebh5zotcIZ4UKdwm1UrGlTeeW e0VhmiVI6MCJ+asd97MfNGFx813nG6oeWTjxqMNFqGYoG1HAajPSdnSKHH8pcn2jll42cyfAAIr8P GMyTrscvIJpjdxoPmCAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXNta-0005Dh-Or; Fri, 05 Jan 2018 09:02:34 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXNtW-00051w-97 for linux-arm-kernel@lists.infradead.org; Fri, 05 Jan 2018 09:02:32 +0000 Received: by mail-pf0-x241.google.com with SMTP id c204so1955721pfc.13 for <linux-arm-kernel@lists.infradead.org>; Fri, 05 Jan 2018 01:02:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=obvT5bC8DmCk2YkO96SFqKzBWwXyfSgiCRt/+ST2dNM=; b=qhEPpnTeblW56T3oPx6lA4YjYO7VnOzrCsMZ49aAqkKbSKOUB3FLTq/h+1CD/oBigG tkFeeRXqfBqQ+UHID7INKSV5zsPD5/vKdczjoh8YClR+4pG0xmVVrurJQ21uPpQtZNJx PasxKP8V3AyPOTIqgJLzTkS0hbST6VDBSczezyfWgi5FcF9YXl2rQaWI/T4wxGszZsb8 bzihBL9A85hoIQkIThaewdQ7SezyW7mTMp/1o1CngLR08v7x4kkaut2nc/Lgsi8cdzNI EQEw+Sv5aAyxwIHY+2b0Sf6KQWVSBSpZp08twL6D5x0EBo3fm1GIhCX4LpQvjjCIc9k+ +2og== 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:mime-version :content-disposition:user-agent; bh=obvT5bC8DmCk2YkO96SFqKzBWwXyfSgiCRt/+ST2dNM=; b=kOdFRf54amvjOGoeS1qXh5JC1e6fSnRLwdTIWNJxFpDfB4wcZc1sFDKmCnvvcuOBCg vLHS314gloChRX36vHRLmb6V2ajIYUvJWArJbeUtxSprymwIXClgHChdSyh3Tx9eHwGQ hn6gheFT2HpxXGsUF18tBSd0xCQpANBTgFNHZJs17ssXPrhUAwF2gVysTXCPEuQkRSLL A3flotXpPnyvRTutE5K+sZ54vWtPmxsMN60BeYINpRCqJfazZYc7AyiANnwX+t/T7hzq Q0H0euk3I74sHlU8viFik0a09jNEWDXOTLspjzBAA0PTZGBctpJA/7rmj6HQOhqxGnm6 vMbw== X-Gm-Message-State: AKGB3mK+Wa2NtZhIihpAnlssmeXlh57Nk/13QNdBIuUAaMFaQhlYFPBM a77PsFP+22mQxhEpu2i9jitGOg== X-Google-Smtp-Source: ACJfBots80RxIqcdwLWZdFu53Xuwp+MQfNqhJ3ox+/sljA7ZwwFAjXIt1CzWqVU0UgozwGh4j+N0TQ== X-Received: by 10.98.67.151 with SMTP id l23mr2311156pfi.194.1515142938770; Fri, 05 Jan 2018 01:02:18 -0800 (PST) Received: from pjb1027-Latitude-E5410 ([58.227.15.43]) by smtp.gmail.com with ESMTPSA id a22sm12868836pfc.47.2018.01.05.01.02.16 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 05 Jan 2018 01:02:18 -0800 (PST) Date: Fri, 5 Jan 2018 18:02:12 +0900 From: Jinbum Park <jinb.park7@gmail.com> To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [kernel-hardening] [PATCH v2] arm: Always use REFCOUNT_FULL Message-ID: <20180105090212.GA4026@pjb1027-Latitude-E5410> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180105_010230_323723_1FA01042 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Dave.Martin@arm.com, will.deacon@arm.com, keescook@chromium.org, ard.biesheuvel@linaro.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 64713b6..e111a62 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -101,6 +101,7 @@ config ARM select OLD_SIGACTION select OLD_SIGSUSPEND3 select PERF_USE_VMALLOC + select REFCOUNT_FULL select RTC_LIB select SYS_SUPPORTS_APM_EMULATION # Above selects are sorted alphabetically; please add new ones
refcount_t overflow detection is implemented as two way. 1. REFCOUNT_FULL - It means the full refcount_t implementation which has validation but is slightly slower. - (fd25d19f6b8d ("locking/refcount: Create unchecked atomic_t implementation")) 2. ARCH_HAS_REFCOUNT - refcount_t overflow detection can be optimized via an arch-dependent way. - It is based on atomic_t infrastructure with some instruction added for detection. - It is faster than REFCOUNT_FULL, as fast as unprotected atomic_t infrastructure. - (7a46ec0e2f48 ("locking/refcounts, x86/asm: Implement fast refcount overflow protection")) ARCH_HAS_REFCOUNT has implemented for x86, not implemented for others. In the case of arm64, Will Deacon said he didn't want the specialized "fast but technically incomplete" refcounting as seen with x86's. But rather to set REFCOUNT_FULL by default because no one could point to real-world performance impacts with REFCOUNT_FULL vs unprotected atomic_t infrastructure. This is the reason arm64 ended up enabling REFCOUNT_FULL. (4adcec1164de ("arm64: Always use REFCOUNT_FULL")) As with the decision of arm64, arm can set REFCOUNT_FULL by default. Signed-off-by: Jinbum Park <jinb.park7@gmail.com> --- v2: Write a better commit message --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+)