Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3267563rwd; Mon, 29 May 2023 08:02:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4eIeseGHgaHcA+VK9eJdLUGJlxPdEBDAaDqRXsbd/fYb4CbuoETmHjxz8ww6rwI4Gm9etP X-Received: by 2002:a17:902:ba8d:b0:1af:d19a:a67b with SMTP id k13-20020a170902ba8d00b001afd19aa67bmr9201255pls.33.1685372528920; Mon, 29 May 2023 08:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685372528; cv=none; d=google.com; s=arc-20160816; b=zCxOqPdolGucNY3ldc/Sjt+/GyUy8er+URn6cYu02cxEJJdHY+22KW6OLXDw8aZ/ia 9WaICLG1ls5/Cg7y5XHyCJrXSxNNCqtd66CqO57OvhCs4JfAHtAGQ7H5HW74eLITyNh/ JCsFdNBDVnmLPwVtigcIIoVMiD7tZKDBk0ZFJTxzWr8DOqIHcP7EkYYuX/TcwOMvWPzD jzDIVC4EYq9/5EGuLsjeKqYQRTVo6CvvX06iE5U9FSGfgSwWGhvmYULGYm3YcqRQbydN 2J4Mi6n/I0yBmmat+/B4TUO2LZt7Fj/UPdtfY9saL44EE54dko4wquiS6me+LG9yTFel ri0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LkEVYGTJUZLFC58767MzB3G1DJSBq+gVyG1W6RWmlbg=; b=pzBTCEu7KcBypY21KKZIC99vteGsos84iFW4q7wcyq9Imx8RcbbcTnFqO26U1CN8TE GN4AxyeVq4b6/0wKNeAsXKp3QjD4kGEbagnO49rzv38XBAvOr4/mJX2nosTOBXG+IFYr NtCVHdtA1ZhkJED2xmRdKBoc+/nwEh+zIxQFRlzETKmAs/6QQHgNXQneT28PKtaR1FUx eL/W5T4qP68LFzAQIOHeQnerRwumsX905S048LvlUOJZbzE1wjskPwedd4kz3/4Ftlsh hoZlwAxTMcexwcvPdjYhFVYUPVflYe3lSefBTuUmLmvMD1019r6I7SeciabGKOxEHuFr 4x+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=OmhRTIWK; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a170903018f00b001b03a1a3169si2823575plg.257.2023.05.29.08.01.53; Mon, 29 May 2023 08:02:08 -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=@gmail.com header.s=20221208 header.b=OmhRTIWK; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbjE2Ou7 (ORCPT + 99 others); Mon, 29 May 2023 10:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjE2Ou6 (ORCPT ); Mon, 29 May 2023 10:50:58 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B45D0B7; Mon, 29 May 2023 07:50:57 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-565ba6aee5fso39618207b3.1; Mon, 29 May 2023 07:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685371857; x=1687963857; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LkEVYGTJUZLFC58767MzB3G1DJSBq+gVyG1W6RWmlbg=; b=OmhRTIWKrDsYJ3rUntEtfxHtHZFmjJNL/2Y9uhSCFac/J5jZcmQRgSWBb5S2LQ2mdh duMLDq7I6cBIR9Ck7Ohj7Gpe0ETo+iNl7otudyBpDBu+drz/siEmGBPqVIHbDhUCHtX6 4SZkVCbgKpfU+p25VNSqPYJz93dhEiAv4cPsWu8zkiu1xRWPY3GypqjaAwT1eVqXinwn +Fsy/NIZeOxwdvvxZBQdiVQn4k64Frn/315+u+Gbx9DDK6JEk5cwmvbiRHl92rhcCEjK ceaBdsANLZWN3eYRfz/T6+azlqxVPxCsX9tNkhGLg5G34XxO1ry1YjaVIvy7cC47vLwJ XLkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685371857; x=1687963857; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LkEVYGTJUZLFC58767MzB3G1DJSBq+gVyG1W6RWmlbg=; b=JV5x6XB8wg4d++FkIET0hhP8zje7MGzw5qnfnlwkBLnYbYD00y8+Hu/kfo3ioePBfm 3LOr6a+aSSSME24BT74vt3xU8tv92I2xVtxiETPDQtLehJgnPkeSX2PZoMET44t+PU6p i+4dOTJGFazYHJtFLSwKGDFZT2gN7xVL07+aTqFGmQicE3yCTvAqr7lbvr3c9LSZH3vs IAnVEofhHaLQu0Nkn664os/KAKiPqss/B3/uKf1X+aZICRqZodiCT49zAD6eDDsr69e9 gfCTyZf4VJ3UQJbBDSkWQ3snE6CPBPJzzJAT8P18+QurQ/bc5vTiQZjXKyDN69NTjn1z twLg== X-Gm-Message-State: AC+VfDzxp77wHkRDXUMShR3pJzDyMlM403Q8jinYx8nus840lt//DMgQ 3tiupoevIlG1evLuYc6RQjfLD7vLy0whbWEmmhg= X-Received: by 2002:a81:6dd7:0:b0:565:2d3d:cd07 with SMTP id i206-20020a816dd7000000b005652d3dcd07mr11200613ywc.35.1685371856906; Mon, 29 May 2023 07:50:56 -0700 (PDT) MIME-Version: 1.0 References: <20230529052821.58175-1-maninder1.s@samsung.com> <20230529105707epcms5p1418eac680ebe1736196706b0db80dd39@epcms5p1> In-Reply-To: <20230529105707epcms5p1418eac680ebe1736196706b0db80dd39@epcms5p1> From: Miguel Ojeda Date: Mon, 29 May 2023 16:50:45 +0200 Message-ID: Subject: Re: [PATCH 1/1] arch:hexagon/powerpc: use KSYM_NAME_LEN in array size To: maninder1.s@samsung.com, "keescook@chromium.org" , Steven Rostedt , Masami Hiramatsu Cc: "bcain@quicinc.com" , "mpe@ellerman.id.au" , "npiggin@gmail.com" , "christophe.leroy@csgroup.eu" , "nathanl@linux.ibm.com" , "ustavoars@kernel.org" , "alex.gaynor@gmail.com" , "gary@garyguo.net" , "ojeda@kernel.org" , "pmladek@suse.com" , "linux-hexagon@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , Onkarnath , Wedson Almeida Filho Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Mon, May 29, 2023 at 1:08=E2=80=AFPM Maninder Singh wrote: > > I Will add co-developed-by` tag. > because this change was identified while we were working on kallsyms some= time back. > https://lore.kernel.org/lkml/YonTOL4zC4CytVrn@infradead.org/t/ > > this patch set is pending and we will start working on that again, so i t= hought better > to send bugfix first. Sounds good to me! (Fixed Wedson's email address) > Yes, I think second buffer was not related to kallsyms, so I have not tou= ched that. Kees: what is the current stance on `[static N]` parameters? Something like= : const char *kallsyms_lookup(unsigned long addr, unsigned long *symbolsize, unsigned long *offset, - char **modname, char *namebuf); + char **modname, char namebuf[static KSYM_NAME_LEN]); makes the compiler complain about cases like these (even if trivial): arch/powerpc/xmon/xmon.c:1711:10: error: array argument is too small; contains 128 elements, callee requires at least 512 [-Werror,-Warray-bounds] name =3D kallsyms_lookup(pc, &size, &offset, NULL, tmpstr); ^ ~~~~~~ ./include/linux/kallsyms.h:86:29: note: callee declares array parameter as static here char **modname, char namebuf[static KSYM_NAME_LEN]); ^ ~~~~~~~~~~~~~~~~~~~~~~ But I only see 2 files in the kernel using `[static N]` (from 2020 and 2021). Should something else be used instead (e.g. `__counted_by`), even if constexpr-sized?. Also, I went through the other callers to `kallsyms_lookup` to see other issues -- one I am not sure about is `fetch_store_symstring` in `kernel/trace/trace_probe_tmpl.h`. Steven/Masami: is that "with max length" in the function docs enough? Is it 0xffff? Thanks! Cheers, Miguel