Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1731103iog; Sat, 18 Jun 2022 19:02:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vJsfF04Af5fHaCXRPmC+d1KDW+pyu+e3iNhQ2/wW5W3YqGzdHp1elcHP9qyIVbNP3oJFOk X-Received: by 2002:a62:6144:0:b0:525:1b46:83de with SMTP id v65-20020a626144000000b005251b4683demr1507873pfb.65.1655604144729; Sat, 18 Jun 2022 19:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655604144; cv=none; d=google.com; s=arc-20160816; b=JOtoWwPepe7nO0LwXyUFWAxfGERFmJgC2E6Lu3KwXT4U7txsL6oTtqeqJ7CRhHCLaN 3NHA5p5zLUr62E3/lW1y6Nnp5WZhbJzkNFGiUXKaMC/VrPrrmPkNA8oxfj47fSlV1PZG SPKShBy0duhZUYAd+5PiB2OWveG4WK8pkvoi7jJUQJYHI2SjqzD314taTv/IaJYraf0B jpQi4YErQpP/LPuh+T+HFuUMS3lVMX5/OdGZH0a4ac+mycUKWbJeq31SauVsObgKVE/f U0tjlsUAnGoPn81WR4V/BIvPIxLmFsb8BBwuB4z9suyllD6Pue/4KL/DPiQbMF+FRH/p vgDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8vfH2d4aXGbYFoRQ1C1A/di4tJyn3VCLYTTFPUgdEmo=; b=B6bWSRwn7T+YbF3SCyT9BCsgMLhIMWeoYq4cw+a7mmb2KL4cyF1+K/MFrBhJJ5QWUq xTi0qk8usPxqkV/5jMA9DmLb3Yu/Tg9SJRCZMCA6IR6h7mMBr4jZWbHIog5M5E7FnjpV rByGycWlVzP2uKE+vby27GjGjPtcgBOcwK5AU7Bir6WsHenhdGqtlo8On7WXvyPtzgNR s/wuT5kNbBkCu5sqwxOaeiBd1uFUeGc1+4UKicJb2sPE4IKNpQAGDhtRgE691iw1KKFT QDje9Sm8BmSFmDJjDDXsmeHQMffbwiAJvpYQndmhmQ6DEepShTb5AJA+7jEwlepQne1P 932w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PjmUHsk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv13-20020a17090b1b4d00b001ea9f836be1si12654240pjb.168.2022.06.18.19.02.03; Sat, 18 Jun 2022 19:02:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PjmUHsk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231161AbiFSB4S (ORCPT + 99 others); Sat, 18 Jun 2022 21:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiFSB4R (ORCPT ); Sat, 18 Jun 2022 21:56:17 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F76DEF8; Sat, 18 Jun 2022 18:56:16 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id h23so15046727ejj.12; Sat, 18 Jun 2022 18:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8vfH2d4aXGbYFoRQ1C1A/di4tJyn3VCLYTTFPUgdEmo=; b=PjmUHsk4ejduQshsd6kONL41Dl1HLFaqnNxEEmMZeAZtG8CIN3DxeyXOalYmUDvOnR vm4hZ/xgdo/lWIIFNZm7n3AG/VoLrMg/ldey2tnEDJqvwo+smU3dGcuLK7iyFE9WoUYC 3z2aUZBInv1XRnJLn0v61a3ne81w0Gms9Q6EnMbz9dXz7yacPznWFd2j0v28INyroCuL 2BbAMaPDoNSXT9KmZ5gvm1IuEUIAU0TzHRn0gMapFQ0LQeo8Q32JPp3XdIY2ZmQIJULL 8dnsvGztGyFVRLew6UOYSGckLgO9swgaY+T/55Du8YvL0EtHBVkCFSdZDuYWUQCqxaG1 grRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8vfH2d4aXGbYFoRQ1C1A/di4tJyn3VCLYTTFPUgdEmo=; b=4mkmvuvKpQfuvJBFbLRf9q0YXH9sL60Qg4RDJHb0HwOWbVD9kOwR7UwFh6qX95YN2O SbquwYj3s1UFogUmJEzJ/AC63/nVgPpuj3/QPJVe2Kpb2m88/WwgPk0YpaN2qlYJuMwa z3q9eZLyCnPNtONsXu2TSdwSFO5Fb+BYM2YWCRGCOwO/lYUcro4uNDaLfyd/aD6o4LET f09Y9HyooetkpX6B8bNgQUQyaRiSkQ+GKez4vonfOBtoflVks/qvnQvtjG8lYjPSgIY2 7fZ/xZu16lDL2cdBUm4CggESUjlDAbSjLmeJj06roZ7wmrFVCVuM0S4qIqzQWUl6FfTQ 1EDg== X-Gm-Message-State: AJIora9sbAFoYgsc+a2QZxKqcnRfb2nrEDBiPBjqiSqA4iUiOWdlnvvv nKg/B+bnoG72xa6C9gnzFUdrLDXakYU6DAPfgJ0= X-Received: by 2002:a17:906:74ca:b0:712:585:751c with SMTP id z10-20020a17090674ca00b007120585751cmr14879127ejl.739.1655603774897; Sat, 18 Jun 2022 18:56:14 -0700 (PDT) MIME-Version: 1.0 References: <20220614084930.43276-1-nashuiliang@gmail.com> <62ad50fa9d42d_24b34208d6@john.notmuch> In-Reply-To: From: chuang Date: Sun, 19 Jun 2022 09:56:03 +0800 Message-ID: Subject: Re: [PATCH] libbpf: Remove kprobe_event on failed kprobe_open_legacy To: Jiri Olsa Cc: John Fastabend , Jingren Zhou , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Masami Hiramatsu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On Sun, Jun 19, 2022 at 5:17 AM Jiri Olsa wrote: > > just curious.. is that because of ipmodify flag on ftrace_ops? > AFAICS that be a poblem just for kretprobes, cc-ing Masami > Yes, the core reason is caused by ipmodify flag (not only for kretprobes). Before commit 0bc11ed5ab60 ("kprobes: Allow kprobes coexist with livepatch"), it's very easy to trigger this problem. The kprobe has other problems and is communicating with Masami. With this fix, whenever an error is returned after add_kprobe_event_legacy(), this guarantees cleanup of the kprobe event.