Received: by 10.213.65.68 with SMTP id h4csp37809imn; Mon, 19 Mar 2018 18:46:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELvGTFcolVFsf7AQofjg0SPqQHvqXRjnaHsqM+10sDCVlZr9K5R6xSKf8DpxbHBck1Qc3Tz0 X-Received: by 2002:a17:902:5957:: with SMTP id e23-v6mr14259284plj.323.1521510396297; Mon, 19 Mar 2018 18:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510396; cv=none; d=google.com; s=arc-20160816; b=dMDdE3uGyx+5KV2ja/kg+wlfc2gsyQaQXiPQlSD0PcHpBasCC3ZCZSHZTzV5HE6/Ib 00k5aUV3bcwp0sgRcWnpLkcZydzoBCNvZgTrkA7Wxs2mnoOF7ypEAXoC6QvEYPHr4Del 1j2SVEEM0DEj+qdeoErh/Q7VO9b1QW0pOHiIl7MIFI40Dp3dhE8xXtzegXnx3EWD9RRr 6eRS3SEI6GEt3UWaCEDwdxbiaybe+VxjJfei3c+Y8CdEQ0crb/8JqalPyJ8jcvcj1NMe mJ4AnHLgwV498zAFek6pUWdGidFxGAFSnzQNGd1X7YIsPw9B7ZWWrASS54AYMFc3FY1W 9mkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wF+9772r45PQfWP3M3F+HGdntpVPlvJ4+TSywRn/lgk=; b=MRERfVkhRNQPZEUTryT6AkC/ku764xF5PfADPnsOm2+rWOMkV3xjLQnUCn4c9oEUU6 9Sa8O6dQMRBonvCEBHuZUZDMsIqwvArU1l/WPuhJDjMVpd1KXjh5IfTfHIJJHcSPcf++ oq13O5vR3Pm+b2uIT+PdrCawMQeoM6iERtTtLidEX4NPsKS3K6EwXI24vVR83xDmsfOv rBY6zyeNO6cpVkid29PEyV44p3e6uNN4eoHTorTqwrl09ZxjhDZMg/TV/QkhgHmNECZR Uckgg+5MMpfe85xPAqV6QgJ8pNYdFl4oiSCkaoy5HOZKkXoyBvuFmd7HX7yW5l7RT9wr zwyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si536998plf.223.2018.03.19.18.46.22; Mon, 19 Mar 2018 18:46:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936003AbeCSTb1 (ORCPT + 99 others); Mon, 19 Mar 2018 15:31:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49518 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031157AbeCSSXd (ORCPT ); Mon, 19 Mar 2018 14:23:33 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9EAC740B; Mon, 19 Mar 2018 18:23:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Dmitry Vyukov , Kees Cook , Sasha Levin Subject: [PATCH 4.9 126/241] lkdtm: turn off kcov for lkdtm_rodata_do_nothing: Date: Mon, 19 Mar 2018 19:06:31 +0100 Message-Id: <20180319180756.416129214@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit 7064dc7fc13b2994d33ae540ffb7a3a05ac463bf ] I ran into a link error on ARM64 for lkdtm_rodata_do_nothing: drivers/misc/built-in.o: In function `lkdtm_rodata_do_nothing': :(.rodata+0x68c8): relocation truncated to fit: R_AARCH64_CALL26 against symbol `__sanitizer_cov_trace_pc' defined in .text section in kernel/built-in.o I did not analyze this further, but my theory is that we would need a trampoline to call __sanitizer_cov_trace_pc(), but the linker (correctly) only adds trampolines for callers in executable sections. Disabling KCOV for this one file avoids the build failure with no other practical downsides I can think of. The problem can only happen on kernels that contain both kcov and lkdtm, so if we want to backport this, it should be in the earliest version that has both (v4.8). Fixes: 5c9a8750a640 ("kernel: add kcov code coverage") Fixes: 9a49a528dcf3 ("lkdtm: add function for testing .rodata section") Signed-off-by: Arnd Bergmann Acked-by: Dmitry Vyukov Acked-by: Kees Cook Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/misc/Makefile | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -61,6 +61,8 @@ lkdtm-$(CONFIG_LKDTM) += lkdtm_perms.o lkdtm-$(CONFIG_LKDTM) += lkdtm_rodata_objcopy.o lkdtm-$(CONFIG_LKDTM) += lkdtm_usercopy.o +KCOV_INSTRUMENT_lkdtm_rodata.o := n + OBJCOPYFLAGS := OBJCOPYFLAGS_lkdtm_rodata_objcopy.o := \ --set-section-flags .text=alloc,readonly \