Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3492767imu; Sun, 11 Nov 2018 16:20:07 -0800 (PST) X-Google-Smtp-Source: AJdET5eSxcKZ2j+9yzGjf1dqU70hJM3Onw1T0KDBw7ajHZdIEYn9VqhvT5EHHc1dMPOqIfFCLPau X-Received: by 2002:a62:76c9:: with SMTP id r192-v6mr17884313pfc.17.1541982007618; Sun, 11 Nov 2018 16:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541982007; cv=none; d=google.com; s=arc-20160816; b=f/ENLGVUFzhZ6mVR5gbcRwvjMMSa1hiYbzxCBGh0Ll2Lfs76YOZgTSQjkWQ9CoQaIZ Ch+mAm0rKe7MtMnW76s592y9tzzFgmF6pQMW/PKtbs5dGkDvT/SqXxAMhVnVp2h60QFk ilX7bCTiV++S/ZF7p/R8e7DlcON6ahxByzmo6XN/yDK3zD9ThNaYKin+oYDhRvbtC7ew jxl0ZB1d9PSvxYLDbiNVF7051XXYq5BeyAg1OLst5r8N7pjhm3KXc/hxBbNbsDEA9fV2 IkhZTN9qXS5I5ChJlz/eh7YgaKyjClIU8IfMUA4vn2vPUa5W5T//Z/6kT4DFwMHPc9h0 P5fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fqDXPq9HndeZuKfsXErtKU96ULK4iZocukPzjB/5nYY=; b=Zm1bE1lsabFWzfiHn0c/jJpDL9OlWsLLAkk9ZB6QDoNyKkthKenlFkw9tZGLLguwFr nwznEeYnuYCn+zXvhyywlyiHRDB4FdVSVsETbW4I12K9WSQxW+k8Au6RPwyX5E43LrLb QbPIJUGHqlNcNHh7/TJntFIqIVe0PSeImYWVjSlYy5DTL/Vs4MLgj9F8H8VwcRB5BvH0 2prwz/jmP+dHlv2xhWqxihBts/+ElTp9K6fkkg75CIwaHeyag0NDxjls7jNd1yEN5qNb 6MgrkDkPYMKjdC/Ct6NClqcWnDJRw5fsGZfi9RxCnQTBsc+jziFqhyWMhx0IBsfAZmb2 8S2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="FAQb/oYX"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si11999812pgc.448.2018.11.11.16.19.52; Sun, 11 Nov 2018 16:20:07 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="FAQb/oYX"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730165AbeKLKIu (ORCPT + 99 others); Mon, 12 Nov 2018 05:08:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:58420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729859AbeKLIQ7 (ORCPT ); Mon, 12 Nov 2018 03:16:59 -0500 Received: from localhost (unknown [206.108.79.134]) (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 303FC21527; Sun, 11 Nov 2018 22:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975224; bh=k9kZusohsPCHrHUwSv6B8dzgjSm86eEbcNlvuEWWaDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAQb/oYX2KDYRnCNHT6o4EXIPAwHDCYlNZ9zarPNOOuIQxP+VnhvAAB4bCpKi3vGN 65DsKS2yu+fPFgp/GVDcZ7e5Q2cDSkJTkFBBunC8rt4LcS1K3SFfZgULVtPbulMBKg UmEUfP15EUxQkjOQn8Rcop/BT61bB5LpCbuUp/X4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nadav Amit , Masami Hiramatsu , "Peter Zijlstra (Intel)" , Alexei Starovoitov , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Oleg Nesterov , Thomas Gleixner , dwmw@amazon.co.uk, Ingo Molnar Subject: [PATCH 4.19 028/361] kprobes/x86: Use preempt_enable() in optimized_callback() Date: Sun, 11 Nov 2018 14:16:15 -0800 Message-Id: <20181111221623.591191775@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu commit 2e62024c265aa69315ed02835623740030435380 upstream. The following commit: a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”) removed local_irq_save/restore() from optimized_callback(), the handler might be interrupted by the rescheduling interrupt and might be rescheduled - so we must not use the preempt_enable_no_resched() macro. Use preempt_enable() instead, to not lose preemption events. [ mingo: Improved the changelog. ] Reported-by: Nadav Amit Signed-off-by: Masami Hiramatsu Acked-by: Peter Zijlstra (Intel) Cc: Cc: Alexei Starovoitov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Thomas Gleixner Cc: dwmw@amazon.co.uk Fixes: a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”) Link: http://lkml.kernel.org/r/154002887331.7627.10194920925792947001.stgit@devbox Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/kprobes/opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -179,7 +179,7 @@ optimized_callback(struct optimized_kpro opt_pre_handler(&op->kp, regs); __this_cpu_write(current_kprobe, NULL); } - preempt_enable_no_resched(); + preempt_enable(); } NOKPROBE_SYMBOL(optimized_callback);