Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4003885imj; Tue, 12 Feb 2019 08:13:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IbblXMSdWT6LP3bMss4xjOMKMs7rQ/uIuf+N87i0Oo6iRPZgQFuZhKckcXSoQR4lyMjr3Uq X-Received: by 2002:a65:4781:: with SMTP id e1mr4318715pgs.346.1549988005071; Tue, 12 Feb 2019 08:13:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549988005; cv=none; d=google.com; s=arc-20160816; b=UHIroRr72nkYzprmMwdH30b7KvXNFPL/Yt4G5Xe6pKcZTfooIBI2hVmJJLqrwiFBmk WZLZ6/CsObcKKQKWhGqN/zunR2veEdompNitM5J6N/+KXztLeXUt8u4C2t1Jcahl8glm G/CBPOM8qh7n5RN+zNao/3Yoby4b6QLiR6JFmd8R0GskJHYpCwr82pWgidNO7PxhVy0o ey7BkYUdvmmskZZNH88UpMqgfg3opoIlru5mV+x+udZ67Z0NoO+J7pTZW1kvNvdvzeUW dYX/6gsAnuiOwkWwiElJ13rSjPUGgMzUBWTA7JDjQ3RvGRooNJ0NTC6EyYSa29Ns/Rez RqFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NrQFc5DGrQbG2oYnOVQ0llVYV70sgQU5/MVmjZSI//U=; b=GCMCB9vYnjO4YUfSzVPPyU2xJZ7n7az52FxDkvucMNegFfzqaTo5WJTgkUuAqoFykp mE76vdHlyrFl6aab7R+xaru/e6pnKjA1kBqmaHYc58k0vrmsL5a8KvjYbQ8JrQB/I6nE heYhrIm5FGuXr4aaCn7JJRhJXBqkmT+TIXG415GkMyEbfPNKd0mtm9oSYzfW2/rF4497 3hxHhQvYdf3DauNT38trIXDvA59SknqN3jJCZVCAZg/rEjTgtU52RfMcnzIZsK4ENiBV OebQMjISXY6MYq5B0sSR33Ymw8g9SZqF7PlBv7Jj6b6b/aqxtYJFLnblgX5cBfQbtTuN Hsmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0QS+CdjO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si14084740ple.389.2019.02.12.08.13.07; Tue, 12 Feb 2019 08:13:25 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=0QS+CdjO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730818AbfBLQML (ORCPT + 99 others); Tue, 12 Feb 2019 11:12:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:41392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbfBLQML (ORCPT ); Tue, 12 Feb 2019 11:12:11 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 508B8217D9; Tue, 12 Feb 2019 16:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549987930; bh=M9BzOKcjSHrnF/hxoyZFdVlh1Oa72HK6z/2/YIL0ijY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0QS+CdjObBH06OCVvng/Ai/JPUVrXlQB/VHsr3Lqjl/th2rrx3NN76fr+tibisFJH zRc7sx5ne7Bav1IBhkKco93CwcwyS47XT+mcRNJyCuPkGV47yiT/vs5tfABFgxVnfN a0S1d7EuXumL1B0/z5BgPJNFLRXVG1rssgvGeevk= From: Masami Hiramatsu To: Ingo Molnar Cc: Masami Hiramatsu , peterz@infradead.org, Mathieu Desnoyers , linux-kernel , Andrea Righi , Steven Rostedt Subject: [PATCH -tip v3 02/10] x86/kprobes: Move trampoline code into RODATA Date: Wed, 13 Feb 2019 01:11:47 +0900 Message-Id: <154998790744.31052.3016106262944915510.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <154998785011.31052.1475728497912659748.stgit@devbox> References: <154998785011.31052.1475728497912659748.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move optprobe trampoline code into RODATA since it is not executed, but copied and modified to be used on a trampoline buffer. Signed-off-by: Masami Hiramatsu --- arch/x86/kernel/kprobes/opt.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 544bd41a514c..f14262952015 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -97,6 +97,7 @@ static void synthesize_set_arg1(kprobe_opcode_t *addr, unsigned long val) } asm ( + ".pushsection .rodata\n" "optprobe_template_func:\n" ".global optprobe_template_entry\n" "optprobe_template_entry:\n" @@ -136,16 +137,10 @@ asm ( #endif ".global optprobe_template_end\n" "optprobe_template_end:\n" - ".type optprobe_template_func, @function\n" - ".size optprobe_template_func, .-optprobe_template_func\n"); + ".popsection\n"); void optprobe_template_func(void); STACK_FRAME_NON_STANDARD(optprobe_template_func); -NOKPROBE_SYMBOL(optprobe_template_func); -NOKPROBE_SYMBOL(optprobe_template_entry); -NOKPROBE_SYMBOL(optprobe_template_val); -NOKPROBE_SYMBOL(optprobe_template_call); -NOKPROBE_SYMBOL(optprobe_template_end); #define TMPL_MOVE_IDX \ ((long)optprobe_template_val - (long)optprobe_template_entry)