Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1280268pxf; Fri, 19 Mar 2021 03:41:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6hu8n9aS+cwDXaCg+1vrdFCTHecQdebte4RZJ53+DSTiSEjcWf4ksoWsmvd2eqzbW88bp X-Received: by 2002:a05:6402:145a:: with SMTP id d26mr8663788edx.182.1616150508740; Fri, 19 Mar 2021 03:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616150508; cv=none; d=google.com; s=arc-20160816; b=Rn0BSk7akf44ORuXuzf6vN5W4thLKwjbRXg3d/YXXjbCJIZPc7HSZiDnbDZePv77Uh v8/sJQ/FPh9Lk9c/PbLzSn2v4CiGMAq26w7JyoB08Xuf/77fjML04v7Qcl5YkfMAbsVr +4jFKmYlrdM+oKuVWkw8JAFLCy+ZK8bqackTKXe9MnuTTCJDTYw3FxtdNUuSGZPspvEm CxklsyeD585d3BftOGeTykN9kMBIYvRG8Dsux6lg/Q03VNk42ZKmoe3+izaWZvuHIU94 8ofIwpmKkpVPp6BaK20VGa+Wq4Hi22HknJOPJdTCz6HVmmGbAvfdM0CCQCwnux3EdUef mDew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=USF3y5zCKsxldD8l/HlH8FCg/p6FJk6mSlnPahCeUd8=; b=V1K93roo2gu/aGIz85ocvSsCWZ6anV48vdEsqFo2dppLcolsJ1+Cs+zIJopszVKiPr jcLs+2SWpTrUS30ckBEV2OZenO2ysqLnFI1owxyBq7ILMV96e7qf+GsCaME1da7J/90D Sq2nSNm2Qz3Xml92CNRzl9ZuVUdlJ78bdaKh5creg2yz58Pi+ERYnDgE7oMtN5Nlz4V5 o1wUdgpHtBAUCrydG3vNnRFhWxnJJRzJW9y6zBLCioNuCpW3ifgAB9UUnKcg4etvSU1L VfeZLHf2L8vI//f1VyzsVEAIBw4XQerFhvfzuboXloWLuY5Tad+JkUZCUn192g/78san MODg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fQb6LIQ+; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si4013053ejy.8.2021.03.19.03.41.25; Fri, 19 Mar 2021 03:41:48 -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=@linuxfoundation.org header.s=korg header.b=fQb6LIQ+; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbhCSKkS (ORCPT + 99 others); Fri, 19 Mar 2021 06:40:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:50382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbhCSKkB (ORCPT ); Fri, 19 Mar 2021 06:40:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C5CF464E6B; Fri, 19 Mar 2021 10:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616150400; bh=upXug4xn2cSMI3wX/C88hwIqnigSyE+kWd7XvhtAWx0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fQb6LIQ+LxulZcdqI5di1q2vhaiBCfkZzN/03rB+k9dHwWyRKyPN/OOsr8N61AUbo G3jMqaXi6SkyXAdKwTI7qhfei+qX80s/hsKBQhHzn1eaPqbDtXf652VHZ/ku150Gmx xZ1JdJjteMr9mPTKNoaojWKGPIZgJD50OblpFWD4= Date: Fri, 19 Mar 2021 11:39:57 +0100 From: Greg Kroah-Hartman To: Nicolas Boichat Cc: stable@vger.kernel.org, Thomas Gleixner , Alexandre Chartre , Peter Zijlstra , Arnd Bergmann , Benjamin Herrenschmidt , Christopher Li , Daniel Axtens , Masahiro Yamada , Michael Ellerman , Michal Marek , "Naveen N. Rao" , Nicholas Piggin , Paul Mackerras , Sasha Levin , linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [for-stable-4.19 PATCH 1/2] vmlinux.lds.h: Create section for protection against instrumentation Message-ID: References: <20210318235416.794798-1-drinkcat@chromium.org> <20210319075410.for-stable-4.19.1.I222f801866f71be9f7d85e5b10665cd4506d78ec@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319075410.for-stable-4.19.1.I222f801866f71be9f7d85e5b10665cd4506d78ec@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 19, 2021 at 07:54:15AM +0800, Nicolas Boichat wrote: > From: Thomas Gleixner > > commit 6553896666433e7efec589838b400a2a652b3ffa upstream. > > Some code pathes, especially the low level entry code, must be protected > against instrumentation for various reasons: > > - Low level entry code can be a fragile beast, especially on x86. > > - With NO_HZ_FULL RCU state needs to be established before using it. > > Having a dedicated section for such code allows to validate with tooling > that no unsafe functions are invoked. > > Add the .noinstr.text section and the noinstr attribute to mark > functions. noinstr implies notrace. Kprobes will gain a section check > later. > > Provide also a set of markers: instrumentation_begin()/end() > > These are used to mark code inside a noinstr function which calls > into regular instrumentable text section as safe. > > The instrumentation markers are only active when CONFIG_DEBUG_ENTRY is > enabled as the end marker emits a NOP to prevent the compiler from merging > the annotation points. This means the objtool verification requires a > kernel compiled with this option. > > Signed-off-by: Thomas Gleixner > Reviewed-by: Alexandre Chartre > Acked-by: Peter Zijlstra > Link: https://lkml.kernel.org/r/20200505134100.075416272@linutronix.de > > [Nicolas: context conflicts in: > arch/powerpc/kernel/vmlinux.lds.S > include/asm-generic/vmlinux.lds.h > include/linux/compiler.h > include/linux/compiler_types.h] > Signed-off-by: Nicolas Boichat Did you build this on x86? I get the following build error: ld:./arch/x86/kernel/vmlinux.lds:20: syntax error And that line looks like: . = ALIGN(8); *(.text.hot .text.hot.*) *(.text .text.fixup) *(.text.unlikely .text.unlikely.*) *(.text.unknown .text.unknown.*) . = ALIGN(8); __noinstr_text_start = .; *(.__attribute__((noinline)) __attribute__((no_instrument_function)) __attribute((__section__(".noinstr.text"))).text) __noinstr_text_end = .; *(.text..refcount) *(.ref.text) *(.meminit.text*) *(.memexit.text*) So I'm going to drop both of these patches from the queue. thanks, greg k-h