Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1070225rwb; Wed, 26 Jul 2023 07:12:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqQlOO6vpIWKQ5WZJBPuVm6Fc+x9sh6T3Fl9S9Lk9b8icH1f6j7L0se5musk9G8PI5ql5n X-Received: by 2002:a05:6a00:b4c:b0:676:20f8:be41 with SMTP id p12-20020a056a000b4c00b0067620f8be41mr2375094pfo.16.1690380735167; Wed, 26 Jul 2023 07:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690380735; cv=none; d=google.com; s=arc-20160816; b=Uphn4kIeHa2T/ol1/NUcv4RGv6IF0hcUY7iP9qLepI2ozFBDl29kKsmGOarm3O113R RObirBDnCNQKN6NeDbfXMtQlnrDwkK3thpmW/GZrAzPXjrY0WVpHckqgOULGCxuxbcWD 74czmuIhqbj/x79wGaTNyHMpCSw3XbV0i2jA2Clc6uv9jauMPcv8bzPNkxuqMaAR3qgV iKMfXe6d75Nkjbq7cS+o8phUm6K0uIhXKFabl20noH3WKKPJmqN4SRQPaWZMGRGv/q7t K65jxYwPzu5jQRFWY967or6nq+SwoZrbl6GksexVwefpuUwqzrkrCzoG+8zN844/Bu4m +eog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=jn8YT4QXzhf79icX43frcS+scUrPudwRPlXjFdtPVoI=; fh=4lbXKtrJ5DL0VWxzf7j82o9jt5GhtVKZHL0x0A1eeNo=; b=p91xITc5gTvItEPDdtkvSoaRV1sBtzBLSCGduiLFv3RjQw1+H9bQiYby7wriXJrCCZ b7q6tLlmqrftPkcQ4sGQwhsJEVc4/EcrLsBDZoxjZnoTk6Bu9MBdGkVpq4k6bRI2QN44 LLPPbj3koHtE1Ez7pH3xoiaoS5xASnMUvme+DmLz8Pq7uEcH3vA086mruMNNgaLnn8vw AEMGL1RdIl9oeoACJE6t9EXqLu4ciGekVPviTR93vLBxwQ4kOSH3LcuHR5e0mnZ0mR2Q X+I69jtqptt3HvnRa73amovCPipIATtHX7BYk11AnWAhkyrGyW51OhAzXgIeuXjhyiOi IuqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=PUg04CxA; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=M4LQ1IB+; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a633f04000000b00563da8d8416si1940894pga.355.2023.07.26.07.12.01; Wed, 26 Jul 2023 07:12:15 -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=@arndb.de header.s=fm2 header.b=PUg04CxA; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=M4LQ1IB+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbjGZN4e (ORCPT + 99 others); Wed, 26 Jul 2023 09:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233169AbjGZN4d (ORCPT ); Wed, 26 Jul 2023 09:56:33 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66ECD2D49; Wed, 26 Jul 2023 06:54:45 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 875505C010E; Wed, 26 Jul 2023 09:54:34 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 26 Jul 2023 09:54:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1690379674; x=1690466074; bh=jn 8YT4QXzhf79icX43frcS+scUrPudwRPlXjFdtPVoI=; b=PUg04CxA/GT3yiMx7o +zIyPgBVG9Ha9lC6KiYsFp7hTGccg7sPMlQxrIT3fJ1Uj4CGN8iOBbHwFQrd3Y8V XVvpMjNyG4qWBNmaMj8UroPCNp8y5ZB6Ae54Usou9WSlw/DpSyEooS+UT2UXH2OG kKeFBvrLVNxolgoiKtg3GTocr+Bc+pxniSPtxBvNcuTlOyrJvopJ/UhEMal6Pk+c u3sUZhUDP+45MQSgQFpMovBNfSeKm/IkwqPNcldRxotDyyfHYDOTKUMFxOMWeP7f F2LafBh3qWAvSkb3uH/5d/S4S6eD3xahygnqTHhHrl9Hr4pkrC3e8Z8sSVoXvyaF ViTA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1690379674; x=1690466074; bh=jn8YT4QXzhf79 icX43frcS+scUrPudwRPlXjFdtPVoI=; b=M4LQ1IB+miqlHpb8x5MagAMmHo/rt 0L9pBrho9r/Ab3XYikuaTsVwfUiT7XuW2r6yjfetRLUat5i3mD1Ef3+r8H/8BcGb Xe+KuXtpBk7yeBuITLr5vOSDMt1Th7Jmc7IDU4QkC9iBqi92Nq7CbxYeLu3R8oB4 P7u48XV2boNDvFSAwb3vEsyjN4UAFqE0vxW4LAuUj88dxGrAXoBVNUFUXtaO0Swd XjlwTUx1HSi3tXFMSsX0sPKom29FAftr22io7VPqomp5NPLvdam652ixMVTBSyvL cu2rATVoIUnUd/1DslyWNDzvuMMxUPClar5ey1m9qrsDFcGZdVvytbDjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedriedvgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2AD45B60089; Wed, 26 Jul 2023 09:54:33 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-592-ga9d4a09b4b-fm-defalarms-20230725.001-ga9d4a09b Mime-Version: 1.0 Message-Id: <4df0dc2a-50d2-4a8f-8a8c-2b2a943f80ae@app.fastmail.com> In-Reply-To: References: <20230724135327.1173309-1-arnd@kernel.org> <20230724135327.1173309-2-arnd@kernel.org> Date: Wed, 26 Jul 2023 15:54:11 +0200 From: "Arnd Bergmann" To: "Jiri Olsa" , "Arnd Bergmann" Cc: "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Steven Rostedt" , "Masami Hiramatsu" , "Luis Chamberlain" , "Martin KaFai Lau" , "Song Liu" , "Yonghong Song" , "KP Singh" , "Stanislav Fomichev" , "Hao Luo" , "Mark Rutland" , "Kees Cook" , "Peter Zijlstra" , "Miguel Ojeda" , "Palmer Dabbelt" , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-modules@vger.kernel.org Subject: Re: [PATCH 2/2] [v2] kallsyms: rework symbol lookup return codes Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, Jul 26, 2023, at 10:02, Jiri Olsa wrote: > On Mon, Jul 24, 2023 at 03:53:02PM +0200, Arnd Bergmann wrote: >> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c >> index 05c0024815bf9..bc0eed24a5873 100644 >> --- a/kernel/trace/ftrace.c >> +++ b/kernel/trace/ftrace.c >> @@ -6965,7 +6965,7 @@ allocate_ftrace_mod_map(struct module *mod, >> return mod_map; >> } >> >> -static const char * >> +static int >> ftrace_func_address_lookup(struct ftrace_mod_map *mod_map, >> unsigned long addr, unsigned long *size, >> unsigned long *off, char *sym) >> @@ -6986,21 +6986,18 @@ ftrace_func_address_lookup(struct ftrace_mod_map *mod_map, >> *size = found_func->size; >> if (off) >> *off = addr - found_func->ip; >> - if (sym) >> - strscpy(sym, found_func->name, KSYM_NAME_LEN); >> - >> - return found_func->name; >> + return strlcpy(sym, found_func->name, KSYM_NAME_LEN); > > hi, > any reason not to call the original strscpy in here? No, that was a mistake. I replaced the other strcpy and strncpy with strlcpy in order to get the desired behavior, but in fact they should all be strscpy, and changing this one was an accident. I'll send a v3. Arnd