From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbdB1QRi (ORCPT ); Tue, 28 Feb 2017 11:17:38 -0500 Received: from mail.kernel.org ([198.145.29.136]:36820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbdB1QRH (ORCPT ); Tue, 28 Feb 2017 11:17:07 -0500 Date: Wed, 1 Mar 2017 01:16:51 +0900 From: Masami Hiramatsu To: Peter Zijlstra Cc: Borislav Petkov , linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Masami Hiramatsu Subject: Re: kprobes vs __ex_table[] Message-Id: <20170301011651.d9961aee415783f3c7b78b19@kernel.org> In-Reply-To: <20170224092646.GL6515@twins.programming.kicks-ass.net> References: <20170223183002.GD6557@twins.programming.kicks-ass.net> <20170224100451.31ca3855ddb36963b93d0768@kernel.org> <20170224092646.GL6515@twins.programming.kicks-ass.net> X-Mailer: Sylpheed 3.5.0 (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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Fri, 24 Feb 2017 10:26:46 +0100 Peter Zijlstra wrote: > One more complication with __ex_table and optimized kprobes is that we > need to be careful not to clobber __ex_table[].fixup. It would be very > bad if the optimized probe were to clobber the address we let the fixup > return to -- or that needs fixups too, _after_ running > __ex_table[].handler(). This gave me a chance to read closer current code, and I found that I made a mistake 5 years ago on kprobe-booster. The commit 464846888d9a ("x86/kprobes: Fix a bug which can modify kernel code permanently") introduced another bug -- which passed the address of copied instruction instead of probing address to search_exception_tables() when preparing kprobe-booster (skips singlestep.) I'll send a fix patch. Thank you, -- Masami Hiramatsu