Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp160177rwd; Mon, 15 May 2023 22:15:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CDBJPkHsFAjoaeYRlw2G5D4D7KEKKYHNMd2aY9B5aEL7FhkaQ+BSZbRw3vDXlLvry+odo X-Received: by 2002:a17:902:db07:b0:1ac:65ab:cf7b with SMTP id m7-20020a170902db0700b001ac65abcf7bmr40258191plx.9.1684214155783; Mon, 15 May 2023 22:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684214155; cv=none; d=google.com; s=arc-20160816; b=vPWBWqwPNvPhQzrXMMlW/kWeQSaMO7XLoKW8E2QYUIIZboKj5VwHVvG5a4HbWsqmSh 6fSL7C5Ris2i8EBF3IdSwnzHWIhQ6tZ9TdwLx5ClKjJYrEVfrFHk9w603dQTxj2PTlBG LgxicTLjgefYoTILhCjrlAKoNznn+TO+0LiZi0bDfZZs9DgIKctqB8YwABtlSsgH4zxv 8WE9OLFdWjfJtu2KGNhyQ+Ehy6cXE5D4VG/OkeeIH339+WOtXRSjcD87wsQc9/22pS35 oBZQnvZhL7hZLvACr5cB+5f89EBIW3amNmO+bqxxfyY5SfYLWaWFke+8RfK3se0JP2PD LCVQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=uM+PYjZuQaQSGbQhg7kjK59LPtCOOEQmuP0baTO+8Gs=; b=iCJSvmuiV5z7jbHOBX/OsW8+Aj6U//R2y3pvLys6QKMBbciC/ECpeHuX5wOAvjnq3H biK+A7Dv9NxqtFzmsDwTJR+YleyJPhyWfiasx+tvf3jDbR5Khax7AXLuHgGoIM1+8o/e 7563MUeCeGsAmnkartCAcE3GSkDbo6r9h8+yNtDKnw1yXnPYEiqQ5qEIAR/dkALy/l6q Oq3MaJPr13vUdNXDfjsvSzSMbnJcgUQp5Ksqyxir6nWOx5FS9hUlDj6egTWzVygoVtPG Y1kqvnVEWHbUmvoFDpmR7M6F0MeGpvN2kWgPuO04VgphJdB8cskNbKhHqxpdDxSXWDs/ b7Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tqHQrw0a; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a170902e9c600b001a6ee332903si17156375plk.347.2023.05.15.22.15.41; Mon, 15 May 2023 22:15:55 -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=@kernel.org header.s=k20201202 header.b=tqHQrw0a; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbjEPEcD (ORCPT + 99 others); Tue, 16 May 2023 00:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjEPEcA (ORCPT ); Tue, 16 May 2023 00:32:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D344A3A9D; Mon, 15 May 2023 21:31:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 53397622E3; Tue, 16 May 2023 04:31:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F23A2C433D2; Tue, 16 May 2023 04:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684211518; bh=e4YAJmKsuD89fgedecS6L/gt/qymF1Yj4L5b7+rCXs8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tqHQrw0aEtEuGx1eXuk9tcITR9fU9OjaNSphg+HVldMiiiS6fOw/r8e+o1eKPTWFL bvmWKNuX4yGRFSVIzBXBO197YEK+mXJIkgs2XfHE9Ye8SxvxRmZE69pjcZvDJCh3Si CXX5raEHLtUI06ZEdO/Kg3X8o7Pyq62kIAAWUwe76RbDXm2arQ/7rDZke2XnA4xz7K yRwPuZpuAYjfcMhN4EhxbhFzZZ/SPSDvrQgJ6andW7doIvygO1zh+j26pj/WYUQXjI epzXKh+LFDWZDB2gT0CLNRJ7GPH4hgQjWqkrNpYYoUE6cM7DN9KgU4oTkYy1v1jgfv Ku3d9x2uXeWCw== Date: Tue, 16 May 2023 13:31:53 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: Yonghong Song , Ze Gao , Jiri Olsa , Song Liu , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Masami Hiramatsu , Ze Gao , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH] bpf: reject blacklisted symbols in kprobe_multi to avoid recursive trap Message-Id: <20230516133153.9627751457e0050159f077ab@kernel.org> In-Reply-To: <20230513001757.75ae0d1b@rorschach.local.home> References: <20230510122045.2259-1-zegao@tencent.com> <6308b8e0-8a54-e574-a312-0a97cfbf810c@meta.com> <20230513001757.75ae0d1b@rorschach.local.home> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 On Sat, 13 May 2023 00:17:57 -0400 Steven Rostedt wrote: > On Fri, 12 May 2023 07:29:02 -0700 > Yonghong Song wrote: > > > A fprobe_blacklist might make sense indeed as fprobe and kprobe are > > quite different... Thanks for working on this. > > Hmm, I think I see the problem: > > fprobe_kprobe_handler() { > kprobe_busy_begin() { > preempt_disable() { > preempt_count_add() { <-- trace > fprobe_kprobe_handler() { > [ wash, rinse, repeat, CRASH!!! ] > > Either the kprobe_busy_begin() needs to use preempt_disable_notrace() > versions, or fprobe_kprobe_handle() needs a > ftrace_test_recursion_trylock() call. Oops, I got it. Is preempt_count_add() tracable? If so, kprobe_busy_begin() should be updated. Thanks, > > -- Steve -- Masami Hiramatsu (Google)