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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13D0FC77B73 for ; Thu, 1 Jun 2023 02:03:13 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4QWqD021jhz3dvr for ; Thu, 1 Jun 2023 12:03:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=iVM+pWfO; dkim-atps=neutral Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4QWqC3031tz30QQ for ; Thu, 1 Jun 2023 12:02:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=iVM+pWfO; dkim-atps=neutral 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 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nathanl@linux.ibm.com, bcain@quicinc.com, keescook@chromium.org, gary@garyguo.net, pmladek@suse.com, linux-hexagon@vger.kernel.org, ustavoars@kernel.org, linux-kernel@vger.kernel.org, Onkarnath , wedsonaf@google.com, npiggin@gmail.com, alex.gaynor@gmail.com, ojeda@kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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