Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp84470rwd; Wed, 31 May 2023 19:29:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6R08Y6yEXssUbXvQuxacEfRzo4vLtBb+5BKzP99bMB3Cs9WHVNVJBs19LUnhWA2QZmLksO X-Received: by 2002:a05:6a00:15c6:b0:64f:e997:510a with SMTP id o6-20020a056a0015c600b0064fe997510amr9512593pfu.3.1685586571598; Wed, 31 May 2023 19:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685586571; cv=none; d=google.com; s=arc-20160816; b=U9NU28lTO9rCcBGgkcngJNo4YlAKAHexWpN13kr0wZ6x+6hzjGqAaBCLILfoYse0xI N8pS71N+1HokjxFJ5s4EUAWaeJpgbp3supRQpdkLVwID17LtMCry9fHarAw+wsGFLSNq 7BdWKEoh0mRvVdkCRc3ZVfmfQcPJFwvQAIu2CdQE9Bk3coxHHoYZomBuULL6grIdbKzX gW06Db3FuCD0jAgglF0CedKpgnpds3Wv7bWF3PHlCFfLsV9iPTEoFgshy/7vBjPO8y+M x79fd59a/SfCJQ/dQbrRzZhNF9AeQbKTgD708forlxwsU2+0hXmLnIikCuMVpUtk9ZYU QNcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=EKqPUa5BbsNp2IS+PVeURMLivGy9/PqofQB8JVPKzHk=; b=CVGcIk+smkJ+zoZrEEn3QMlU56D4mxZAtr5TncwTKL8jt/AfNhw5U9bfcpO0e2W9Zv HoqcFX+IX7rZTCQzzcB8bYRe2I08PwbealCUjn0p1JHj/W4it/8pEZdFRzQJCeSxCBBa nctaG8y1D9DTLoy+5I5vrSHfZUngwBUfw8NtABoojjTigA35QY13kR3wss2s1bM7zLk7 HnUei+KP+6jdhf/Hn8xKQnlunO+hTQt61KkLZwlm+crKgBWn9FSJ9XjPgpKL5zrMcIpb Z4mJ2fBJDUEu29sscMCQ8kVSN423K0TgpZIBMTj46/KDDMRnCRg86lYcQQTbfTNym7jT bq+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=iVM+pWfO; 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 w21-20020aa79555000000b0063d3aed5eb8si4558817pfq.140.2023.05.31.19.29.16; Wed, 31 May 2023 19:29:31 -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=@ellerman.id.au header.s=201909 header.b=iVM+pWfO; 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 S230285AbjFACC3 (ORCPT + 99 others); Wed, 31 May 2023 22:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjFACC2 (ORCPT ); Wed, 31 May 2023 22:02:28 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA9D2A3; Wed, 31 May 2023 19:02:25 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4QWqBz5Fkpz4x42; Thu, 1 Jun 2023 12:02:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1685584941; bh=EKqPUa5BbsNp2IS+PVeURMLivGy9/PqofQB8JVPKzHk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iVM+pWfOIbhHL9f9DmsNTYSYsnsKADtZjQT9IBkW+solKs/5jaM7HmHXujPBPR3sR wMMXiW8q5QUIc2tF+b7pContzFBOjsvsrQZp+PB993f8ACrE562bCVTAPxc4nHPlVT 1JaDyr37YE8RGysSYBHCWpx6blwoqIhVENU7L02HS4t35C05grIv/jnerzHXtBFxkr LlFZ4pTbtpMi1kzvCtW/E0KSPxtdyhZedudAUHM4yCfBKpWkN+tj7x/zD6gocR2QVp hI0nknDZgWcSY2pAmQYBBAJ+nUybSxOQcns2PjvlZPakzmphOIgWmf3ANOTX/gtTkW 24NljidWcxz/Q== From: Michael Ellerman To: Miguel Ojeda , Maninder Singh Cc: bcain@quicinc.com, npiggin@gmail.com, christophe.leroy@csgroup.eu, keescook@chromium.org, nathanl@linux.ibm.com, ustavoars@kernel.org, alex.gaynor@gmail.com, gary@garyguo.net, ojeda@kernel.org, pmladek@suse.com, wedsonaf@google.com, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Onkarnath Subject: Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size In-Reply-To: References: <20230529111337.352990-1-maninder1.s@samsung.com> <20230529111337.352990-2-maninder1.s@samsung.com> Date: Thu, 01 Jun 2023 12:02:16 +1000 Message-ID: <87ilc8ym6v.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, 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 Miguel Ojeda writes: > On Mon, May 29, 2023 at 1:14=E2=80=AFPM Maninder Singh wrote: >> >> +static char tmpstr[KSYM_NAME_LEN]; > > Reviewed-by: Miguel Ojeda > > Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being > used, but the name seems discarded? Can > `kallsyms_lookup_size_offset()` be used instead, thus avoiding the > usage of the buffer there to begin with? A few lines below it uses the modname, and AFAICS there's no (easy) way to lookup the modname without also looking up the name. > Side-note 2: in `scanhex()`, I see a loop `i<63` using `tmpstr` which > then is used to do a `kallsyms_lookup_name()`, so I guess symbols > larger than 64 couldn't be found. I have no idea about what are the > external constraints here, but perhaps it is possible to increase the > `line` buffer etc. to then allow for bigger symbols to be found. Yeah that looks wrong. I don't see any symbols that long in current kernels, but we should fix it. Thanks for looking. cheers