From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB6E9C282C3 for ; Tue, 22 Jan 2019 09:41:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BEC0218DE for ; Tue, 22 Jan 2019 09:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548150096; bh=1FAQWM4mCylQVm4r45erpo5w+dyQ0c5g0VsG7tQjhY4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=imb7Jera/ThssJDWwBcbFVMCCkSoCbv6+0yADnRnkAjk4yqbv8g55qWx0gxTyPDLV BcLRKLK2nbmpnPSfYJne0S4f9xp2RXwFxj/2qIkNOcTA/Oe9rlmJlG4zEEdlgWjCuF DS6Qa345UhHhmhSNcKWUTa+H0CCPFOjTzYxHnHNM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727710AbfAVJlg (ORCPT ); Tue, 22 Jan 2019 04:41:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:60124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbfAVJlf (ORCPT ); Tue, 22 Jan 2019 04:41:35 -0500 Received: from devbox (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 A4982218D9; Tue, 22 Jan 2019 09:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548150094; bh=1FAQWM4mCylQVm4r45erpo5w+dyQ0c5g0VsG7tQjhY4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AG8h48vH3ETR4jdRolCj/peBXqzIojx86zEwf7S4wuzS2aks9YBv38J+D7wogHI3v 8qhda7nRokUdHna3FrwfCP35Bjw2lT+Aq4heFId5IdBySuhanvDpTzHo8Y6B6yHPcb P9saLXFHh2Gq2qlcc46ixf5OkVuS4LeeDuQE6H5g= Date: Tue, 22 Jan 2019 18:41:31 +0900 From: Masami Hiramatsu To: Sasha Levin Cc: Ingo Molnar , peterz@infradead.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/9] x86/kprobes: Prohibit probing on optprobe template code Message-Id: <20190122184131.f13bd5f96092ca1839dce4b5@kernel.org> In-Reply-To: <20190116133559.8FBCB2082F@mail.kernel.org> References: <154725996885.18060.7107278512876517981.stgit@devbox> <20190116133559.8FBCB2082F@mail.kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, 16 Jan 2019 13:35:58 +0000 Sasha Levin wrote: > Hi, > > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: 9326638cbee2 kprobes, x86: Use NOKPROBE_SYMBOL() instead of __kprobes annotation. > > The bot has tested the following trees: v4.20.2, v4.19.15, v4.14.93, v4.9.150, v4.4.170, v3.18.132. > > v4.20.2: Build OK! > v4.19.15: Build OK! > v4.14.93: Build OK! > v4.9.150: Build failed! Errors: > ./include/linux/kprobes.h:494:22: error: initializer element is not constant > ./include/linux/kprobes.h:494:22: error: initializer element is not constant > ./include/linux/kprobes.h:494:22: error: initializer element is not constant > ./include/linux/kprobes.h:494:22: error: initializer element is not constant Ah, this is related to commit 54a7d50b9205 ("x86: mark kprobe templates as character arrays, not single characters") Before this change, I used & optprobe_template_*, so it the patch should be +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); (since optprobe_template_func is a function symbol, it doesn't need &) > > v4.4.170: Failed to apply! Possible dependencies: > 21266be9ed54 ("arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug") > 44a95dae1d22 ("KVM: x86: Detect and Initialize AVIC support") > 520040146a0a ("KVM: x86: Use vector-hashing to deliver lowest-priority interrupts") > 5881f73757cc ("svm: Introduce AMD IOMMU avic_ga_log_notifier") > 5c919412fe61 ("kvm/x86: Hyper-V synthetic interrupt controller") > 6308630bd3db ("kvm/x86: split ioapic-handled and EOI exit bitmaps") > c0dd671686b2 ("objtool: Mark non-standard object files and directories") > c207aee48037 ("objtool, x86: Add several functions and files to the objtool whitelist") > c6d308534aef ("UBSAN: run-time undefined behavior sanity checker") > d62caabb41f3 ("kvm/x86: per-vcpu apicv deactivation support") > f876f440df39 ("crypto: sha256-mb - SHA256 multibuffer job manager and glue code") OK, commit 935893a17a99 ("objtool, x86: Add several functions and files to the objtool whitelist") introduced optprobe_template_func, so for v4.4.X and v3.18.X, we don't need the first line. So the patch should be something like, "optprobe_template_end:\n"); +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) > > v3.18.132: Failed to apply! Possible dependencies: > 0b24becc810d ("kasan: add kernel address sanitizer infrastructure") > 131484c8da97 ("x86/debug: Remove perpetually broken, unmaintainable dwarf annotations") > 24933b82c0d9 ("x86/asm/entry: Rename 'init_tss' to 'cpu_tss'") > 76f5df43cab5 ("x86/asm/entry/64: Always allocate a complete "struct pt_regs" on the kernel stack") > 8ef46a672a7d ("x86/asm/entry: Add this_cpu_sp0() to read sp0 for the current cpu") > 905a36a28518 ("x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/") > 9d0c914c60f4 ("x86/asm/entry/64/compat: Change the 32-bit sysenter code to use sp0") > a232e3d558ee ("x86/asm/entry/32: Update "interrupt off" comments") > b87cf63e2a5f ("x86/asm/entry: Add comments about various syscall instructions") > c0dd671686b2 ("objtool: Mark non-standard object files and directories") > c207aee48037 ("objtool, x86: Add several functions and files to the objtool whitelist") > c63f06dd1579 ("kasan: move KASAN_SANITIZE in arch/x86/boot/Makefile") > ef7f0d6a6ca8 ("x86_64: add KASan support") > f876f440df39 ("crypto: sha256-mb - SHA256 multibuffer job manager and glue code") > > > How should we proceed with this patch? I'll send backport patches for those versions. Thank you, > > -- > Thanks, > Sasha -- Masami Hiramatsu