From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA1BEEE4996 for ; Mon, 21 Aug 2023 14:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232506AbjHUOpj (ORCPT ); Mon, 21 Aug 2023 10:45:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbjHUOpj (ORCPT ); Mon, 21 Aug 2023 10:45:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FACBE3; Mon, 21 Aug 2023 07:45:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 97049617A6; Mon, 21 Aug 2023 14:45:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4765DC433C8; Mon, 21 Aug 2023 14:45:36 +0000 (UTC) Date: Mon, 21 Aug 2023 10:45:50 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Song Liu , Francis Laniel , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Kees Cook Subject: Re: [RFC PATCH v1 1/1] tracing/kprobe: Add multi-probe support for 'perf_kprobe' PMU Message-ID: <20230821104550.57d60a75@gandalf.local.home> In-Reply-To: <20230821190152.c467e40a5ee3d57715600159@kernel.org> References: <20230816163517.112518-1-flaniel@linux.microsoft.com> <20230818213705.b4f5e18b392c4837068cba6f@kernel.org> <20230818114141.2a3a75ee@gandalf.local.home> <4853240.31r3eYUQgx@pwmachine> <20230818142033.1d7685e9@gandalf.local.home> <20230819101519.568d658fbb6461cc60d348e5@kernel.org> <20230820183218.bf0b04be3c0ccac5e7b2a587@kernel.org> <20230820221612.33dfc3b3072f8bd8517f95b5@kernel.org> <20230821190152.c467e40a5ee3d57715600159@kernel.org> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Mon, 21 Aug 2023 19:01:52 +0900 Masami Hiramatsu (Google) wrote: > > kprobe BPF program has access to pt_regs, so it can read ip of the > > attached function. Can we do the same with regular kprobe (no bpf)? > > Yes, it can. So I think it is OK to expand CAP_PERFMON to access kallsyms. > But this means CAP_PERMON itself is not safe in some case. What are the privileges that CAP_PERFMON gives. I can see why Kees told me to avoid capabilities when looking at what has access to tracefs. Because it becomes very difficult to know what the privileges you are giving when you give out a capability. I just stick to normal ACL (file permissions) and everything is much easier and simpler to know what has access to what. -- Steve