Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5064321pxb; Mon, 15 Feb 2021 08:34:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAAcSspFMD8WhZayVO2Q9/jgJ/4skcSIqpGGgynDi5yyx/Px5duv5R0N5YxtICuue+ZSl5 X-Received: by 2002:a05:6402:2053:: with SMTP id bc19mr16111983edb.230.1613406854140; Mon, 15 Feb 2021 08:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613406854; cv=none; d=google.com; s=arc-20160816; b=Ji9AlW+tpVBuwuK3N6SRYTZtyLgvLh0CXSM2RRopBRUEbwyUtRUkDJ3BcimRwKrxEL bZBaZi6R10SCMCx6Biuipy/NWwkkRirUfCvYDlYbYBcOED406XGFmOWqn70afsc5+ZU5 1MR9f84MvLqy9p1YpAndNIwdiokyvWRFykZRwM+6frdU8vXyLyVlhsv9bUl8NmSduAjZ H7MTtDQo8uWunKrrHtNalmLN1woD7BoAAsXatVGPNtdpBg5i9RUqd5ZMGQ6nI+VhdDRl 97xo2bgvv0OHYH6QkWZJ3Y0hfmNLYRb/nJYBdbBU/ylB/7kj30WfY8IzmZQnjAK56N8i xQrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1jLbkbLbywfavODrgS/3I8Yam3D1BogsRb4JL/F5uOQ=; b=q3BfHx6Zf7drYqOxbICGtgzHZr9UXIxaBx6+IusCz9k+nRffesg4pgs2l3kyovrMYR lN88rTnAh8FSUqOnmWp1gd69xJYmYnvJaN79zVaBn4nVh1CRtzZesQKaT66yGkExHkpo M7bSrURWhZnv50I9osmkpmf++/Y1feZBlzRJOMfDksu1IqR104LK4ypuq8JgIYIq1bvO wQJN5OsX7F7Q+fmOnoGJyjYqtfX8ceMu7mA0Zn3nIBnK7SsGqG0aFmLgd0A2etrLTccW UmwZzOXyI/L8KfEMxh3Is2NvgkRKCrRowkRIu/UG5l1EhRpqWFt9JsRzHNfiSnreuoqz f9qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QpMpydnu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd22si9079652edb.69.2021.02.15.08.33.51; Mon, 15 Feb 2021 08:34:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QpMpydnu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232342AbhBOQdU (ORCPT + 99 others); Mon, 15 Feb 2021 11:33:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:50362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231425AbhBOPhk (ORCPT ); Mon, 15 Feb 2021 10:37:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F1C564DEE; Mon, 15 Feb 2021 15:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403170; bh=KweFA7IRadDskMiNVr6d6PMy5T6GyKj7eecvLMkpI0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QpMpydnu3oxDDHMP9INmCwFiGFubZOS3OVvRzKEstysXElQ/t8AXe0Hnpudh/1PC6 myZhJtdPUE3SWtN5Z/NREwA1YY/cWeQ6sk1W3I2ikyK0JwcQOu0yH/+Uto1xkNg+oJ vqgB71jbIPVfoAddm8NkwboRxuNg4UDU11KtyhAg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Borisov , Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Sasha Levin Subject: [PATCH 5.10 055/104] bpf: Unbreak BPF_PROG_TYPE_KPROBE when kprobe is called via do_int3 Date: Mon, 15 Feb 2021 16:27:08 +0100 Message-Id: <20210215152721.255908467@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexei Starovoitov [ Upstream commit 548f1191d86ccb9bde2a5305988877b7584c01eb ] The commit 0d00449c7a28 ("x86: Replace ist_enter() with nmi_enter()") converted do_int3 handler to be "NMI-like". That made old if (in_nmi()) check abort execution of bpf programs attached to kprobe when kprobe is firing via int3 (For example when kprobe is placed in the middle of the function). Remove the check to restore user visible behavior. Fixes: 0d00449c7a28 ("x86: Replace ist_enter() with nmi_enter()") Reported-by: Nikolay Borisov Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Tested-by: Nikolay Borisov Reviewed-by: Masami Hiramatsu Link: https://lore.kernel.org/bpf/20210203070636.70926-1-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin --- kernel/trace/bpf_trace.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 0dde84b9d29fe..fcbfc95649967 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -93,9 +93,6 @@ unsigned int trace_call_bpf(struct trace_event_call *call, void *ctx) { unsigned int ret; - if (in_nmi()) /* not supported yet */ - return 1; - cant_sleep(); if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1)) { -- 2.27.0