Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1010043rwb; Tue, 27 Sep 2022 07:21:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MXu9o1JcIqsjUrMfU/QSnO1hX6W/yiKZAXS2p1RpV0Tq/Ss+sAPp2Uiqc885qcUfGunjN X-Received: by 2002:a17:902:cec4:b0:176:be0f:5c79 with SMTP id d4-20020a170902cec400b00176be0f5c79mr28065062plg.40.1664288496792; Tue, 27 Sep 2022 07:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664288496; cv=none; d=google.com; s=arc-20160816; b=McrnyszPmN7lHHxOZC+B2vSKU6XAEfWY+zXcfvg/xZ2h62qZMRAxkxb3nZmpuZZ25/ 9El5jEUeZtUIFy6DgSJOy27bOox+cGeQeFW2YC/+br+C8QjFPMOtpNma/CK4J9pA/9FM Et7kxgSAM5YldD2DppXhcTiMwkGtUBOu5TTjUzUDzHomFBJpAnq6ckdzlD8mavCleaGO eqZnRzX4OIKEUmvcboGf3aHP7fMj4MrYtm0kLcmmVgSG9TkkajAXtl50lZF9awEUoLAs WHY6hTKgq7KrtWmSzVKZwlChKykLV+puIdHghWR439jXL+/91mHwjj24tavD/9DUnJhe KfQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Xncc9hud5ayNISty9myCBT0z8BSFPAgLkQrv8fW4IDo=; b=elfiHktvwUuI6IHsRCYy3FORMeOnXJgx8IyfLX+/QI8T6udDtoog/eFo+IOmy8IF3D 4nEbdMFiSBj7r/Y740wqUHmOx6xd+FsYZbUL2TVU9YQdmyLjYTQ7ZBUPsoEelBHMk7zT 1oEekyIvmYLCZ2L89HbHr3jkn1xQzMX1KQ9XzZwOrl9e6UU8V3b17PIbzgp53MyGggnE JRVZByE+sBfUXJagqYCWDFUaYS3fLnYZZPtloOrogfK0aaHFFNvHXSzhBjgu4PDGmnnm ljtNEkexwu9Egi23e3YkdLLLW/gW6uxK/0EL5hZQfUex0g192qs3SnAtNLive4QExJ+j X+Eg== ARC-Authentication-Results: i=1; mx.google.com; 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 oj16-20020a17090b4d9000b001fd87298f34si2177046pjb.54.2022.09.27.07.21.23; Tue, 27 Sep 2022 07:21:36 -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; 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 S232577AbiI0OFu (ORCPT + 99 others); Tue, 27 Sep 2022 10:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbiI0OFq (ORCPT ); Tue, 27 Sep 2022 10:05:46 -0400 Received: from hop.stappers.nl (hop.stappers.nl [141.105.120.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04C441EECE; Tue, 27 Sep 2022 07:05:45 -0700 (PDT) Received: from gpm.stappers.nl (gpm.stappers.nl [IPv6:2a02:a46d:659e:1::696e:626f]) by hop.stappers.nl (Postfix) with ESMTP id 088DA2000F; Tue, 27 Sep 2022 14:05:42 +0000 (UTC) Received: by gpm.stappers.nl (Postfix, from userid 1000) id AD319304049; Tue, 27 Sep 2022 16:05:41 +0200 (CEST) Date: Tue, 27 Sep 2022 16:05:41 +0200 From: Geert Stappers To: Miguel Ojeda Cc: Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Jarkko Sakkinen , Boqun Feng , Kees Cook Subject: Re: [PATCH v10 01/27] kallsyms: use `ARRAY_SIZE` instead of hardcoded size Message-ID: <20220927140541.zpb2effrshaxndqi@gpm.stappers.nl> References: <20220927131518.30000-1-ojeda@kernel.org> <20220927131518.30000-2-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220927131518.30000-2-ojeda@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Tue, Sep 27, 2022 at 03:14:32PM +0200, Miguel Ojeda wrote: > From: Boqun Feng > > This removes one place where the `500` constant is hardcoded. > > Reviewed-by: Kees Cook > Signed-off-by: Boqun Feng > Co-developed-by: Miguel Ojeda > Signed-off-by: Miguel Ojeda > --- > scripts/kallsyms.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c > index f18e6dfc68c5..8551513f9311 100644 > --- a/scripts/kallsyms.c > +++ b/scripts/kallsyms.c > @@ -206,7 +206,7 @@ static struct sym_entry *read_symbol(FILE *in) > > rc = fscanf(in, "%llx %c %499s\n", &addr, &type, name); > if (rc != 3) { > - if (rc != EOF && fgets(name, 500, in) == NULL) > + if (rc != EOF && fgets(name, ARRAY_SIZE(name), in) == NULL) > fprintf(stderr, "Read error or end of file.\n"); > return NULL; > } > -- > 2.37.3 > Reviewed-by: Geert Stappers Regards Geert Stappers Hopes to see the kallsyms patches getting accepted, that they don't show up in v11 of the Rust patch serie. -- Silence is hard to parse