Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3714841iob; Sat, 7 May 2022 12:51:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyatuNlrJArDLToFtaYPtiVgbtYs/VtzGCr3MNKsp8LFSWUofBfKi3CCmWEtoUV9I+dlPtW X-Received: by 2002:a17:906:2518:b0:6f4:d34d:c202 with SMTP id i24-20020a170906251800b006f4d34dc202mr8257372ejb.710.1651953092487; Sat, 07 May 2022 12:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651953092; cv=none; d=google.com; s=arc-20160816; b=HDPb7R7ePRdK4eVcUPGAHcGLMdNKWhjQdk/N/h8DV7yGW0kcxO0YG6IBjZF0poVIs+ 7jKuJ8d4wqpb14H/BJk7bm9ld8+jBpsUcs5JSzoO1y5mlIiHyZa5AqLD4YsC8B6clZMP EGPS5fHqH4a9Ihx014h+ZnRBiq79avwK2wSxQgdPnQKCqfWXKdp1Tupltm6SogYNlDam u+UhQP0rijGgHElXlLAhn2GnZ986XmRtOa2FcM1FK1zfCTA5MY/3duN8rRVjr3IxZHcv QNhk0o4hmah3jKqtlhFZbukVyR72xdlNcfVI/EmYDpHx5wjiTdl/SOtGwWEB2E5KD4d8 i8XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jfCqPDeeSaGFFEME8Ca8+0Y3WqdQwWkIOfIAg0xgMNQ=; b=Qs6N86ANyBlGqRuZaCI04pCDP4gOhU5vdLYTG+y91pifbhvtEnExe80PCTue6SuvNw knUmlNAzIkJ87xhl5pH8dS+9XGfPxQIjtnpDOIsr67OHiw+UE83HGsl3lTYLNH9DGd2r DfmMBtyaJzPzrI5vb4x7wlkz/DQR2gaqCC0cfroKnbXG98Xql8auOOJFnQM9sg9xoL1Q U3IdcqNcWYuYCMuoiIbVCBO94WQs8R7AlaHGbPYDuzaBTTgJBerejYzdEj8fYlJCTapj QQNm113NekuWduQb7+YcEw+UN4/hGi2iCmXzj+xfWDUfCMvlk2hQnD3PYB1FXRQ5JsTZ g2SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qmDgoJ0i; 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 jz8-20020a170906bb0800b006df76385bb8si8741573ejb.88.2022.05.07.12.51.09; Sat, 07 May 2022 12:51:32 -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=20210112 header.b=qmDgoJ0i; 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 S1392215AbiEFNCX (ORCPT + 99 others); Fri, 6 May 2022 09:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346526AbiEFNCW (ORCPT ); Fri, 6 May 2022 09:02:22 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6576868F86; Fri, 6 May 2022 05:58:36 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id i20so7963740ion.0; Fri, 06 May 2022 05:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jfCqPDeeSaGFFEME8Ca8+0Y3WqdQwWkIOfIAg0xgMNQ=; b=qmDgoJ0izFpWUD+ROEjPOAPmt+1ewR7azB70xyNRmjxviEKMBdlPRCjCXKGqVtR0lL 6j3U5GRoU8o0sufHiyyjcS0H4NPPYeNtJDq2aR1cVv09J+pTSYsUbLWu3Fo2xCdDErBq 2qTisgxylEvpmJKPAKpl/J/oYsbBuBSzQm46vE6wMvCbJELMptrdHqWZwb0HRAX3viGS eJYTFCXE8KdyfbHiLDPshzWY0JPYnpFd+HVO5fJmGQGHV/64d2b/xtcEATZhDn+7T8d2 F51mBRiRqMqLGXWfRUAFCrV8bsgCl1IFNBIYxoD4HARXp2AboZTfWb785s1JfA7kMO71 j+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jfCqPDeeSaGFFEME8Ca8+0Y3WqdQwWkIOfIAg0xgMNQ=; b=IBKs/6fsGzWbqpR+b3pSLqOakXbhO03uc2wk5yl/OSol5GcyJeX+R32Ts2xxc9Zp6y 3617vLdGCmSgGZ43Zhc3XGc0M2V/GGRdILJx9xgtKInA4SLtKJGD/00s8+ZD++RYLuRN PqO5g2idtFTx6j0auSIDH/rgLt9TIYNtglWaDE5CG9xINiCQCcNKCrFGUV6W2QYLW9bA KZ84NbOT16TW2rqNN1WrBJTbagLse1qXwK3ih9dJWiGqT79DGdFedY9PG3CuziZP5M0r ztoncebghLVUWpuLDkh1BsIuYVZBDUW/rpdtJ2qoJHJSnqn4tP8i9ESAbVxDiASyQl11 0HBA== X-Gm-Message-State: AOAM532jLvCRJy7SvxDlT2fMal2WtM5fMApVTym2U0cFcjP3TjBT/RrB 23kgPYoL5iblnJP0oTCTyydSxYX8hSBPZCNraT4= X-Received: by 2002:a02:8624:0:b0:32b:397d:eeb1 with SMTP id e33-20020a028624000000b0032b397deeb1mr1438879jai.264.1651841915781; Fri, 06 May 2022 05:58:35 -0700 (PDT) MIME-Version: 1.0 References: <20220505191704.22812-1-ojeda@kernel.org> <20220505191704.22812-2-ojeda@kernel.org> <7e20c844dadacb3dac822220ca108f4d786ceb7d.camel@HansenPartnership.com> In-Reply-To: <7e20c844dadacb3dac822220ca108f4d786ceb7d.camel@HansenPartnership.com> From: Miguel Ojeda Date: Fri, 6 May 2022 14:58:24 +0200 Message-ID: Subject: Re: [PATCH v1 1/3] kallsyms: avoid hardcoding the buffer size To: James Bottomley Cc: Miguel Ojeda , Masahiro Yamada , Changbin Du , Nick Desaulniers , Nathan Chancellor , linux-kernel , rust-for-linux , Boqun Feng Content-Type: text/plain; charset="UTF-8" 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 Hi James, On Fri, May 6, 2022 at 1:19 PM James Bottomley wrote: > > When you raise KSYM_NAME_LEN to 512, this on stack allocation becomes > 2049 bytes. How did you manage not to trigger the frame size warning, > which is 1024 on 32 bit and 2048 on 64 bit by default? Thanks for taking a look! If you mean `CONFIG_FRAME_WARN`, that applies to kernel objects, not scripts. If I enable it for `HOSTCC` with a 2048 threshold, we do get the warning: scripts/kallsyms.c: In function 'read_symbol': scripts/kallsyms.c:257:1: warning: the frame size of 2080 bytes is larger than 2048 bytes [-Wframe-larger-than=] 257 | } | ^ as well as in a few other places (e.g. for my config [0]), but given it is userspace it should be fine unless they happen to end up recursing quite a few times. Cheers, Miguel [0] scripts/mod/modpost.c: In function 'main': scripts/mod/modpost.c:2636:1: warning: the frame size of 4208 bytes is larger than 2048 bytes [-Wframe-larger-than=] 2636 | } | ^ scripts/mod/sumversion.c: In function 'get_src_version': scripts/mod/sumversion.c:419:1: warning: the frame size of 4272 bytes is larger than 2048 bytes [-Wframe-larger-than=] 419 | } | ^ usr/gen_init_cpio.c: In function 'cpio_mkgeneric_line': usr/gen_init_cpio.c:223:1: warning: the frame size of 4384 bytes is larger than 2048 bytes [-Wframe-larger-than=] 223 | } | ^ usr/gen_init_cpio.c: In function 'cpio_mknod_line': usr/gen_init_cpio.c:293:1: warning: the frame size of 4400 bytes is larger than 2048 bytes [-Wframe-larger-than=] 293 | } | ^ usr/gen_init_cpio.c: In function 'cpio_mkfile_line': usr/gen_init_cpio.c:456:1: warning: the frame size of 12560 bytes is larger than 2048 bytes [-Wframe-larger-than=] 456 | } | ^ usr/gen_init_cpio.c: In function 'cpio_mkslink_line': usr/gen_init_cpio.c:150:1: warning: the frame size of 8496 bytes is larger than 2048 bytes [-Wframe-larger-than=] 150 | } | ^ usr/gen_init_cpio.c: In function 'main': usr/gen_init_cpio.c:640:1: warning: the frame size of 8528 bytes is larger than 2048 bytes [-Wframe-larger-than=] 640 | } | ^ drivers/tty/vt/conmakehash.c: In function 'main': drivers/tty/vt/conmakehash.c:290:1: warning: the frame size of 65584 bytes is larger than 2048 bytes [-Wframe-larger-than=] 290 | } | ^