From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from integral2.. (unknown [36.80.217.41]) by gnuweeb.org (Postfix) with ESMTPSA id 513C97E3A7; Sun, 17 Apr 2022 18:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1650221620; bh=/kPtSWRc0KtmAGf/TJnNPSFjePQzsOaG0qGy1WYQSwc=; h=From:To:Cc:Subject:Date:From; b=qaUrhiwTaIgdLI/C6BgvvIrlcalrSWzxBnGlKryTRy+8NZnLMICyybwIPK2O51AQC 3D7+nyyiwIAyuynogmqbBlpNCjCv+n1JN9weRKSgUmZ/mMhf2pi+MJ+SGYL3Z5+0Hf tRe9+42p2D8aOQQflhBA4rG7AvQuWFLYcTOi92BtT/e7T1OE9CpTvCM9+f52KJ7Ab8 r2sm4nDRZ/GcTrCNU5b7VkEj8XYzNrkeW6plFex/8Gfs8zgillgO+v2rRf30l/jwnq S3ltzXLTt/96dVaz3nEIQbH/28tR48TVE+Fu5JlGSrKcdHvuLiEeL4v8IhTCYp8Nj6 OLcqWI0sVjlSw== From: Ammar Faizi To: Steven Rostedt , Ingo Molnar Cc: Ammar Faizi , GNU/Weeb Mailing List , Linux Kernel Mailing List , Linux Trace Devel Mailing List Subject: [PATCH 0/2] Two tracing patches for trace_events_hist.c Date: Mon, 18 Apr 2022 01:53:21 +0700 Message-Id: <20220417185323.198034-1-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Hi, Two patches here. ## Patch 1 If `WARN_ON(!glob)` is ever triggered, we will still continue executing the next lines. This will trigger the more serious problem, a NULL pointer dereference bug. Just return -EINVAL if @glob is NULL. ## Patch 2 Change `if (strlen(glob))` to `if (glob[0])`. No need to traverse to the end of string. If the first byte is not a NUL char, it's guaranteed `if (strlen(glob))` is true. Signed-off-by: Ammar Faizi --- Ammar Faizi (2): tracing: Return -EINVAL if WARN_ON(!glob) triggered in event_hist_trigger_parse() tracing: Change `if (strlen(glob))` to `if (glob[0])` kernel/trace/trace_events_hist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) base-commit: a1901b464e7e3e28956ae7423db2847dbbfb5be8 -- Ammar Faizi