Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp958367pxb; Wed, 3 Mar 2021 22:31:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxhrhcEjUbcIPLSaQfM4QkenMnSEI1utI7YH0umvkZYFe1D/WcahekCjLKouiDfSkWzqiL X-Received: by 2002:a17:907:766f:: with SMTP id kk15mr2662596ejc.24.1614839499288; Wed, 03 Mar 2021 22:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839499; cv=none; d=google.com; s=arc-20160816; b=T6GftENhf6areGqyaDDyZ7Xy173+JI25+/Sabz7AYlMYXdm7TPdXTblDIz9m3oH0fT W6wUy95fgEV9EukZU7cafymNNn8zN/ijHlggy1n8Wgzt108EK8oACFbo3dgYPoQWRwRT fZMPB7266qClDnsafTUuglUSJfvf2rlj5ilGQg0siUmEiD2xO35OInwPcCWTaZMpmvMY uk3PgjNbbFOSowTNcD9GaBPWtt3nnOIZOpEpvqp3LI6gM5lXmiICB1urYUI7a3JOcMzM xJmGbE3lSy60k7OEglLqF7WWeajTDhP+3ZCrgiK5OOwp0aqKWFooW2re+/ExIIdBVkoo /Tlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yNNO+4pSKBS0FcXnsXzZgvulZMvXDNeTgIo2L03S8N8=; b=DoiJn2fUsMQp3cWodAIBmov1LZDIgx9ol1wvZQW2MMYHV5BGKAoIdcEViDhYpik9Co GqsyYwsE5iZUVTdF1BtOwiAPx5HqUb7VnVG8ImA6STA3HmID4mWL6k0IhFI+FSCEIB4w llaadc6dm5RMadHBtTOBVBKH+4b9aZXlq1+vxE9g1DzN6rrGgcvdhWo5iJZcYnz9l5MS U66bmzNBfTnLb/YDW7Xe7LCydfT7cP1WMw8phO5L+GnMV4cJVeVNhJtlX5/EckGkmKYb WfAXS2PRG45JhWJ90j4aqNzJrZGmKnmfKd+yP3TTBznweUvlAhSaxEz2xiC5Tie1WfMK x18Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="H/YNq1OZ"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si8918021ejz.420.2021.03.03.22.31.17; Wed, 03 Mar 2021 22:31:39 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b="H/YNq1OZ"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579372AbhCBQrR (ORCPT + 99 others); Tue, 2 Mar 2021 11:47:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:46498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351409AbhCBOW4 (ORCPT ); Tue, 2 Mar 2021 09:22:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 787F064FC6; Tue, 2 Mar 2021 11:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614686383; bh=CTUYJnv8MliY6J4+/hZzZcFP6aNEEDo1FTIlzbrUvho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/YNq1OZZD1CV3lXXOHdzjCfx4A0MlzaPT676QtletGBwmyBEfupA7Cf0baVj2HX8 lR/l/njacwglldCMvtX4zctPsrdM8vT91/isotBPe1xhWD+RVFNUN33ZNHIvCS/6gX Cfzv/Q7VSjwYKTJW6gpTT9S1+kGhEs/thtAbpkwLsn4CHPfKuDjKZxf/cCgv+hndkz 1fRqzlyx5ppqYu0Q+/NODcggTPVJ3khdev5m00v0f368Mm1jvyIg2HAuVX+N5Uewbe wW/lIu3ddIlyr1P7oT5qG98m+s1QfxOXMN5P0QExcqyZ7ARciUmG/KhnvZG5UIllWU lWmXy+tCbi95Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sami Tolvanen , Kees Cook , Sasha Levin Subject: [PATCH AUTOSEL 4.4 5/8] x86, build: use objtool mcount Date: Tue, 2 Mar 2021 06:59:32 -0500 Message-Id: <20210302115935.63777-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210302115935.63777-1-sashal@kernel.org> References: <20210302115935.63777-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sami Tolvanen [ Upstream commit 6dafca97803309c3cb5148d449bfa711e41ddef2 ] Select HAVE_OBJTOOL_MCOUNT if STACK_VALIDATION is selected to use objtool to generate __mcount_loc sections for dynamic ftrace with Clang and gcc <5 (later versions of gcc use -mrecord-mcount). Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook Signed-off-by: Sasha Levin --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 1bee1c6a9891..2e2ddc864ea9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -94,6 +94,7 @@ config X86 select HAVE_CONTEXT_TRACKING if X86_64 select HAVE_COPY_THREAD_TLS select HAVE_C_RECORDMCOUNT + select HAVE_OBJTOOL_MCOUNT if STACK_VALIDATION select HAVE_DEBUG_KMEMLEAK select HAVE_DEBUG_STACKOVERFLOW select HAVE_DMA_API_DEBUG -- 2.30.1