From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbcFNJ7q (ORCPT ); Tue, 14 Jun 2016 05:59:46 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34997 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbcFNJ7o (ORCPT ); Tue, 14 Jun 2016 05:59:44 -0400 Date: Tue, 14 Jun 2016 11:59:40 +0200 From: Ingo Molnar To: Steven Rostedt Cc: Masami Hiramatsu , Ingo Molnar , linux-kernel@vger.kernel.org, Peter Zijlstra , Ananth N Mavinakayanahalli , Thomas Gleixner , "H . Peter Anvin" , Andy Lutomirski , systemtap@sourceware.org, Linus Torvalds , fenghua.yu@intel.com Subject: Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in fault-on-single-stepping Message-ID: <20160614095939.GA31809@gmail.com> References: <20160611140648.25885.37482.stgit@devbox> <20160613191345.6bdeb535@gandalf.local.home> <20160613192019.219a3a5f@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160613192019.219a3a5f@gandalf.local.home> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Steven Rostedt wrote: > On Mon, 13 Jun 2016 19:13:45 -0400 > Steven Rostedt wrote: > > > > > # cd /sys/kernel/debug/tracing > > > # echo p copy_user_enhanced_fast_string+5 > kprobe_events > > > # echo 1 > events/kprobes/enable > > > > > > And you'll see a kernel panic on do_debug(), since the debug > > > trap is not handled by kprobes. > > > > > > To fix this problem, we just need to clear the TF bit when > > > resetting running kprobe. > > > > > > > This should definitely be marked for stable, and I bisected it all the > > way down to this commit: f4cb1cc18f364d "x86-64, copy_user: Remove zero > > byte check before copy user buffer." > > > > I reverted that commit and sure enough, this bug goes away. I'm not > > saying the revert should be done. I'm just doing an FYI, and showing how > > changes that appear to be a nice clean up can have subtle effects. I'm > > not even sure how that change caused this to be a problem with kprobes. > > > > Nevermind, reverting that commit only moved the location of the > "rep movsb" that you were placing the kprobe on. When I do: > > echo "p copy_user_enhanced_fast_string+9" > kprobe_events > > I get the same result. > > That means we need to make that stable tag even earlier. I added: Cc: stable@vger.kernel.org # All the way back to ancient kernels Thanks, Ingo