Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1986957iob; Thu, 5 May 2022 12:33:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHI09m50SoDzzfdZivyKkkI/qqnOnb7GLdUGI1Wo/RWV1vsqq1zcE22bDvNTx9+7ekd3pO X-Received: by 2002:a63:7208:0:b0:3c5:f9ba:f46a with SMTP id n8-20020a637208000000b003c5f9baf46amr6620597pgc.303.1651779183295; Thu, 05 May 2022 12:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651779183; cv=none; d=google.com; s=arc-20160816; b=TCfQOV6TMqLvt8VnWWqtAkFnB54eUf/Ml0qGLqxhTP73aesAKCKGg5T7XeMD4ytYvc Nm92a0637zOQHcUGEnj8j8LqRrHAAk99N4K7iQ8acPBFdW/L6XzIPoxzu6VsarlHq8uk zlqiTYTPai5Q3eU5rVLSYIN9eP4tNrf/+eky7YU/U8LKZOVrvlUOwF43MMkk5nJw5z04 RdB7A0RVYTFfvBokF6SRIDZCvnalT0arvqBu0OmK6AhhFe9TH8DGWJjGChFUJXPYuPuq pKCoNDYzrW8nepokyAlwT9KNlTfFpYQbkEri8YWOjeXXPPHxYF5DJfiL4CYuAPj3cHdQ YVxg== 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; bh=ahGBC2/wmX6ZRnK8Uucfs9tAhsrrQjmnaQNylSB3Xnw=; b=N1nU2BwUx9VnropGSFO1X0xf+epRO4VC5qS7OVsLZr15Uvw/LcfOE2RT9hgurdMZnv qc7WOVmMSY6k4G7ZPZzA/2ONHAMqvVMYqRP70ALlWUQntGVdOxkBG8KIx3llCpBo+Lcm 1szsx+FUEw/XlM+vZ3Gz3ra/jaRRjmU6q8AcpzsBK3iVMdBwAYbBgNCIZZwV4/qhp0yU mIRzn/UpCugfmVoT/a6S+Vs9imkbwGXQBrW3c8MfGopvOPXpxxF+uUlb7JRDz6IYbvTk PC9YsL+6OXF+kcdx7Kt4JC3UlBtbUlN+uPuOoPM1n2hY/ifj5x47xUmgL+n8CX1fgNLj xx0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a170902c94700b00158f817a27bsi11796pla.148.2022.05.05.12.32.46; Thu, 05 May 2022 12:33:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356495AbiEELBZ (ORCPT + 99 others); Thu, 5 May 2022 07:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356365AbiEELAz (ORCPT ); Thu, 5 May 2022 07:00:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 852754EA0F; Thu, 5 May 2022 03:56:54 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5544A106F; Thu, 5 May 2022 03:56:54 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.29.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1F9233FA27; Thu, 5 May 2022 03:56:52 -0700 (PDT) Date: Thu, 5 May 2022 11:56:45 +0100 From: Mark Rutland To: Peter Zijlstra Cc: Chen Zhongjin , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, jthierry@redhat.com, catalin.marinas@arm.com, will@kernel.org, masahiroy@kernel.org, jpoimboe@redhat.com, ycote@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, ardb@kernel.org, maz@kernel.org, tglx@linutronix.de, luc.vanoostenryck@gmail.com Subject: Re: [RFC PATCH v4 22/37] arm64: kernel: Skip validation of kuser32.o Message-ID: References: <20220429094355.122389-1-chenzhongjin@huawei.com> <20220429094355.122389-23-chenzhongjin@huawei.com> <20220505092448.GE2501@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505092448.GE2501@worktop.programming.kicks-ass.net> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 05, 2022 at 11:24:48AM +0200, Peter Zijlstra wrote: > On Thu, May 05, 2022 at 11:36:12AM +0800, Chen Zhongjin wrote: > > Hi Peter, > > > > IIRC now the blacklist mechanisms all run on check stage, which after > > decoding, but the problem of kuser32.S happens in decoding stage. Other > > than that the assembly symbols in kuser32 is STT_NOTYPE and > > STACK_FRAME_NON_STANDARD will throw an error for this. > > > > OBJECT_FILES_NON_STANDARD works for the single file but as you said > > after LTO it's invalid. However STACK_FRAME_NON_STANDARD doesn't work > > for kuser32 case at all. > > > > Now my strategy for undecodable instructions is: show an error message > > and mark insn->ignore = true, but do not stop anything so decoding work > > can going on. > > > > To totally solve this my idea is that applying blacklist before decode. > > However for this part objtool doesn't have any insn or func info, so we > > should add a new blacklist just for this case... > > OK, so Mark explained that this is 32bit userspace (VDSO) code. > > And as such there's really no point in running objtool on it. Does all > that live in it's own section? Should it? It's placed in .rodata by a linker script: * The 32-bit vdso + kuser code is placed in .rodata, between the `vdso32_start` and `vdso32_end` symbols, as raw bytes (via .incbin). See arch/arm64/kernel/vdso32-wrap.S. * The 64-bit vdso code is placed in .rodata, between the `vdso_start` and `vdso32` symbols, as raw bytes (via .incbin). See arch/arm64/kernel/vdso-wrap.S. The objects under arch/arm64/kernel/{vdso,vdso32}/ are all userspace objects, and from userspace's PoV the existing secrtions within those objects are correct, so I don't think those should change. How does x86 deal with its vdso objects? Thanks, Mark.