From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423054AbcFMXUY (ORCPT ); Mon, 13 Jun 2016 19:20:24 -0400 Received: from smtprelay0245.hostedemail.com ([216.40.44.245]:34634 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751598AbcFMXUX (ORCPT ); Mon, 13 Jun 2016 19:20:23 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:3873:3874:4250:5007:6261:7875:7901:7903:7904:10004:10400:10848:10967:11026:11232:11658:11914:12043:12114:12438:12517:12519:12663:12740:13069:13255:13311:13357:13439:14096:14097:14181:14659:14721:21063:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: guide88_306b8f8a2f61 X-Filterd-Recvd-Size: 2444 Date: Mon, 13 Jun 2016 19:20:19 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: 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: <20160613192019.219a3a5f@gandalf.local.home> In-Reply-To: <20160613191345.6bdeb535@gandalf.local.home> References: <20160611140648.25885.37482.stgit@devbox> <20160613191345.6bdeb535@gandalf.local.home> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-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 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. -- Steve