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 CCC30C25B08 for ; Sat, 20 Aug 2022 13:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346208AbiHTNnw (ORCPT ); Sat, 20 Aug 2022 09:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344987AbiHTNnt (ORCPT ); Sat, 20 Aug 2022 09:43:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8026513F06 for ; Sat, 20 Aug 2022 06:43:48 -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 451B36069D for ; Sat, 20 Aug 2022 13:43:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 981C2C433D6; Sat, 20 Aug 2022 13:43:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oPOlc-005ALG-1k; Sat, 20 Aug 2022 09:44:00 -0400 Message-ID: <20220820134316.156058831@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 20 Aug 2022 09:43:16 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Masami Hiramatsu , Tzvetomir Stoyanov , Tom Zanussi Subject: [PATCH v2 0/6] tracing/eprobes: Fixes for unexpected arguments Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While using eprobes, I decided to entertain the thougth of what would happen if I tried to get the instruction pointer "%rip", knowing full well that eprobes do not have access to pt_regs. Well, I found out, and it led me down a rabbit hole of bugs. This series fixes those bugs, by not allowing register access for eprobes, and also filling the holes of @symbol and @immediate argument. Changes since v1: https://lore.kernel.org/all/20220820014035.531145719@goodmis.org/ - Fixed parenthesis warning - Fixed comment about comm arguments - Made kprobes and eprobes process "$COMM" as well as "$comm" - Made filters consistent with histograms with "common_cpu" Steven Rostedt (Google) (6): tracing/eprobes: Do not allow eprobes to use $stack, or % for regs tracing/eprobes: Do not hardcode $comm as a string tracing/eprobes: Fix reading of string fields tracing/eprobes: Have event probes be consistent with kprobes and uprobes tracing/probes: Have kprobes and uprobes use $COMM too tracing: Have filter accept "common_cpu" to be consistent ---- kernel/trace/trace_eprobe.c | 91 ++++++++++++++++++++++++++++++++++++++++++--- kernel/trace/trace_events.c | 1 + kernel/trace/trace_probe.c | 29 +++++++++------ 3 files changed, 104 insertions(+), 17 deletions(-)