Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1009718ybm; Tue, 21 May 2019 07:19:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxNL0muqLX4npBRf688isW7e22nyNJj6zE8sAnlqaN3H0uQH0asU1QITgP/q0xWkpRIWeK X-Received: by 2002:a17:902:1ea:: with SMTP id b97mr56523497plb.317.1558448371520; Tue, 21 May 2019 07:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558448371; cv=none; d=google.com; s=arc-20160816; b=F54x8DwjEYDUeWAHLtWFwJmbY/LyrMhbGaOUdD0L76QMXHdZcbGO1/mlZfvbJdNB7K D0RcHnovwOViKmU1Qfaqr05Fa9Tu8Nv0ucdkpgocXYqMYyXTWA/m2znyCBVb9alMKs/D 9Ryj4DbBaeRkCENYP29ydRPoZwR6jQ50ZtrY0z5zoWEeHYtS4AGZ+FXuNXN7WzGCXe8B Cr4ZpSXH/64JtBCFDo09Ke5Sb1Mh0yqqGkB5YIYkY79Q4PuDcczfqsHYEWQ/T1nXWSUi dDIh0YRK79UU/n7VogyBpeMn4AuAv7Cu1jpAyv9chKZEjmmGiiCFsCkpRmTmDl7AkNkq raTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+TkTuofG3rzLZDTX69lSKUIds9mzWqXl+daZvsZcxTE=; b=VxBOUe0vuqZrFdixq0ldD4GD/Z3R/OGhw8Jva7YJTY7oFHJXximfNOI+oAHMriCwFJ Q9C460KGIBwUqaB6gLC7QrqLHDaO1ovy5RPW+z3zWqO8tTC5UgE50FqN4KbgRXDCUsKL NATBdvtQD590kwcGrVpC0DhEmiQh16zUv2b0MLjGl1D0vOybVFrOyYD1w2vIatkPvy9x hmXZbKxN0IokaHR9blLU2dbdd3h9gkICo/iKgASFBqMEAB1LYlX6PnINolghgtr9UxLY WZQBTDZExGCiKV2ipcqUDQp9w9+H2NxRPEr1NpuimKAKlLFCP/TJoFQ792DJVK5C8WmY 7D5Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si20173166pgm.425.2019.05.21.07.19.14; Tue, 21 May 2019 07:19:31 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728127AbfEUOQm (ORCPT + 99 others); Tue, 21 May 2019 10:16:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726750AbfEUOQm (ORCPT ); Tue, 21 May 2019 10:16:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12CA47FDEC; Tue, 21 May 2019 14:16:37 +0000 (UTC) Received: from treble (ovpn-125-173.rdu2.redhat.com [10.10.125.173]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5774F17A73; Tue, 21 May 2019 14:16:31 +0000 (UTC) Date: Tue, 21 May 2019 09:16:29 -0500 From: Josh Poimboeuf To: Steven Rostedt Cc: Johannes Erdfelt , Joe Lawrence , Jessica Yu , Jiri Kosina , Miroslav Benes , Ingo Molnar , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Oops caused by race between livepatch and ftrace Message-ID: <20190521141629.bmk5onsaab26qoaw@treble> References: <20190520194915.GB1646@sventech.com> <90f78070-95ec-ce49-1641-19d061abecf4@redhat.com> <20190520210905.GC1646@sventech.com> <20190520211931.vokbqxkx5kb6k2bz@treble> <20190520173910.6da9ddaf@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190520173910.6da9ddaf@gandalf.local.home> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 21 May 2019 14:16:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 20, 2019 at 05:39:10PM -0400, Steven Rostedt wrote: > On Mon, 20 May 2019 16:19:31 -0500 > Josh Poimboeuf wrote: > > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > > index a12aff849c04..8259d4ba8b00 100644 > > --- a/kernel/trace/ftrace.c > > +++ b/kernel/trace/ftrace.c > > @@ -34,6 +34,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > > > @@ -2610,10 +2611,12 @@ static void ftrace_run_update_code(int command) > > { > > int ret; > > > > + mutex_lock(&text_mutex); > > + > > Hmm, this may blow up with lockdep, as I believe we already have a > locking dependency of: > > text_mutex -> ftrace_lock > > And this will reverses it. (kprobes appears to take the locks in this > order). > > Perhaps have live kernel patching grab ftrace_lock? Where does kprobes call into ftrace with the text_mutex? I couldn't find it. -- Josh