Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp986669iog; Mon, 13 Jun 2022 18:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWhiIOBZuVqySBYeqnSqjU3S6HA1Rj8CPLV9bw/GyXzpVhoi5xRGLekkRppf+HAeIlALF0 X-Received: by 2002:a05:6402:f0d:b0:42d:d813:c13a with SMTP id i13-20020a0564020f0d00b0042dd813c13amr2974116eda.207.1655168818393; Mon, 13 Jun 2022 18:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655168818; cv=none; d=google.com; s=arc-20160816; b=FN4Y7KSRP+WJHZZqihtcSne8l09GKiQKOV98Ivsaqwz/+mZdkMH5YBaY4ux9/v+Smb 3FypntXSxiBlePK8GnvrWAEk3jtVkh8L4Y/j74oRr1eWukcKxBXmCXyoc3u4b5lYrf+q 5mGUOb1zA7Qb0vvaaxY7ZgwsV28iAY4xdweu30VOEddKmNogj/HVeMI/ZAx1ALrNIg/X ssn93Qut5vCDX3Vl8ENT3/SfLgOhWNGt9UGP9aX/wdSWazyR8ZUvCYLBG3fb0JQxnRSR QLow131nIIKl+NKfOL1YT89zoxO0UuGoVyvwSn9nzQjAk3Qn0nf8KNF2xpy4wGKjpk/G JX6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=zMvaLG5fr7e0A8364yt7KMOJ+b17CQQted93WjMHcX4=; b=MsPC4d72pULMLui3F2GeMxoNxPODwO94+O83deItuXgATqw7phPPx+8BtpWOji3uL9 wHzwtaOFUFFkXA1Obbye7LCkPFNrySbUBSterz2ofxg5HdtU6LKYnUPn2qNn8LA8vSmM iUUc8aJJNmXtJ0R+wztbwLvOBqg0ZwK4zbcuD7tmOxnCQ3JjdOuOvhrwonfBWDipZZIm OHwSV2011j6Guq0UHc+2ilSDiEntTjxMpTJWFJ3NdiPcU6mUV1iN2h+5Ih6ys+ieKftT KtpoVc86CQyNnJFRFuaJmXAWMRUrKb4mZFSAhzBHlT9YAJh0eHlgOhl6IslrM4ISoWLk zNZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=I7c73gIo; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 25-20020a170906015900b006feb4cd0e22si8233909ejh.331.2022.06.13.18.06.15; Mon, 13 Jun 2022 18:06:58 -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=@quicinc.com header.s=qcdkim header.b=I7c73gIo; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232340AbiFNAst (ORCPT + 99 others); Mon, 13 Jun 2022 20:48:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbiFNAss (ORCPT ); Mon, 13 Jun 2022 20:48:48 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA9F22B254 for ; Mon, 13 Jun 2022 17:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1655167726; x=1686703726; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zMvaLG5fr7e0A8364yt7KMOJ+b17CQQted93WjMHcX4=; b=I7c73gIo2N7XEcZW8rWvF+9ArJyyoaICrsIlxQ3TvZ3UlL/s8Xl58f3M 6j51RiSwCwArl+KSA7hLQYh/ACrSdUXwrbyAWPemZFW7zEXQvkzA9794R 8TA7dD5+7s9jVE75y0xnmAPlbS44zr3Ev+ydenk7xxKjWQj+LtGFZkQ24 A=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 13 Jun 2022 17:48:46 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2022 17:48:46 -0700 Received: from nalasex01b.na.qualcomm.com (10.47.209.197) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 13 Jun 2022 17:48:32 -0700 Received: from [10.253.77.15] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 13 Jun 2022 17:48:30 -0700 Message-ID: Date: Tue, 14 Jun 2022 08:48:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v4 1/3] tracing: eprobe: remove duplicate is_good_name() operation Content-Language: en-US To: Tom Zanussi , Steven Rostedt , Masami Hiramatsu , Ingo Molnar CC: References: <1654171861-24014-1-git-send-email-quic_linyyuan@quicinc.com> <1654171861-24014-2-git-send-email-quic_linyyuan@quicinc.com> <9a7e0b6087540c9f868d60cbfc88ccefa8070a1b.camel@kernel.org> From: Linyu Yuan In-Reply-To: <9a7e0b6087540c9f868d60cbfc88ccefa8070a1b.camel@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 Tom, On 6/14/2022 5:01 AM, Tom Zanussi wrote: > Hi Linhu, > > On Thu, 2022-06-02 at 20:10 +0800, Linyu Yuan wrote: >> traceprobe_parse_event_name() already validate group and event name, >> there is no need to call is_good_name() after it. >> >> Signed-off-by: Linyu Yuan >> --- >> v2: drop v1 change as it is NACK. >>     add it to remove duplicate is_good_name(). >> v3: move it as first patch. >> v4: no change >> >>  kernel/trace/trace_eprobe.c | 4 ---- >>  1 file changed, 4 deletions(-) >> >> diff --git a/kernel/trace/trace_eprobe.c >> b/kernel/trace/trace_eprobe.c >> index 7d44785..17d64e3 100644 >> --- a/kernel/trace/trace_eprobe.c >> +++ b/kernel/trace/trace_eprobe.c >> @@ -878,16 +878,12 @@ static int __trace_eprobe_create(int argc, >> const char *argv[]) >>                 sanitize_event_name(buf1); >>                 event = buf1; >>         } >> -       if (!is_good_name(event) || !is_good_name(group)) >> -               goto parse_error; > traceprobe_parse_event_name() is only called if (event). In the > !event case, wouldn't the is_good_name() checks still be needed (since > in that case buf1 is assigned to event)? when user input no  event name, it will generate event name from second  SYSTEM.EVENT, and it will validate with following traceprobe_parse_event_name(). ( if you agree, i will send a new version to update a minor issue in second patch,         sys_event = argv[1]; -       ret = traceprobe_parse_event_name(&sys_event, &sys_name, buf2, -                                         sys_event - argv[1]); -       if (ret || !sys_name) +       ret = traceprobe_parse_event_name(&sys_event, &sys_name, buf2, 0); +       if (!sys_event || !sys_name)                 goto parse_error; ) > >> >>         sys_event = argv[1]; >>         ret = traceprobe_parse_event_name(&sys_event, &sys_name, >> buf2, >>                                           sys_event - argv[1]); >>         if (ret || !sys_name) >>                 goto parse_error; >> -       if (!is_good_name(sys_event) || !is_good_name(sys_name)) >> -               goto parse_error; > I agree this one isn't needed. > > Thanks, > > Tom > >> >>         mutex_lock(&event_mutex); >>         event_call = find_and_get_event(sys_name, sys_event);