Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp736314ioo; Thu, 26 May 2022 13:37:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXrU3e5jA9LVLdaNrnbEKfAv4IMdEOdlU/jEuy9M17eG3iPgzg1+44B/TpnUhfilDTCHzG X-Received: by 2002:a17:902:d48b:b0:163:889f:6e28 with SMTP id c11-20020a170902d48b00b00163889f6e28mr2264948plg.162.1653597430920; Thu, 26 May 2022 13:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653597430; cv=none; d=google.com; s=arc-20160816; b=EcZLBHAkMwnfno0rZ/+pufG3B3dj3KZ/ZC3/zYqGWw6kjDYUTN5T2ce+OAzMmhqBk1 frb5DVBI36uL5lbBAsMZIO7J2lYt1ZrMuiMw4ofXQFBbzHivot+33xKzBIeMPDwveZsl a67dkIVND5XxLDeVsrNoHC2TZ42SJ6l+go30COpt75xBqYs90JpE0x0zLEK/RfjcxwZh K2zzRoeFt+pWxmXbIzw8Rui2D9Vi02WIlKlhBEQCb4fdjr5XsB/3RvDFHXo0zVlUrX8G Me9LrenOLZ6B9DzPMTTMuTPlzoBPWCm2zJSoXKvpT5sDSd0PA6THiptjEKmzdaEU6Wph H0Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GJA7HrZF7acJQBfhiDXjcPEpN2o4b30vGxAX0o5jzuM=; b=RKtX9+75OgYzr/rZ4nx7CqFqY8nnAcNvVC3O2yS+MT4Z2k459hhIdX++ZPqjK7Zxly OK9oeBK6MsUfBHb+BP/d37kp4uGQsiBkbcwH2ouUMNUvq8OnMthB8ujJQ+IkP0Jnj160 hoobvPKEIBGyoFAMG/tXqLBhGIKfiAjwCCW3+Qq4UzBwyzfs30ivkGgPoMieKM3g7dxT C1sn0Upv5W24NHysBLOndEo01BZP059Cfj7nJSuYC13aGd1n0qnBI9GCTrAKk41rcy3q El9hmPnYN1tUN3yK7kRHCQK5pYtOQKFfu4+b9/ZH+01Kzl/DIjkgA9NPw6EBjk5Xx4km lELQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sOUrYenL; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020aa78ec6000000b0050a73a14910si361534pfr.218.2022.05.26.13.36.59; Thu, 26 May 2022 13:37:10 -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=@kernel.org header.s=k20201202 header.b=sOUrYenL; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244125AbiEZEzy (ORCPT + 99 others); Thu, 26 May 2022 00:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbiEZEzw (ORCPT ); Thu, 26 May 2022 00:55:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB49BA563; Wed, 25 May 2022 21:55:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9AB33B81F52; Thu, 26 May 2022 04:55:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD327C385A9; Thu, 26 May 2022 04:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653540948; bh=oZ+I6TDmQs9q1v5bWWln6OxdEcIwohbwhkD9F724NiY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sOUrYenLVDJ+DgKGJwX+ZWcUw1VMOEBMCENn5Iu3Iezo1lPWMWk8muUU8XSwVMVIN nAuAN/9VQUxIvOnlXiIxg0/jZ6s+r0K50XuRUAsskleRRLIPhxPdEkdUexV/KOAoKE ww92/aJOYdeAjbulbl/3vXZPNq4zeONFnXn+9Pz/ZAtxR6lM9DAgyE9MgOe05CYnNu hdlFaRYGAukK+s3GbxGv9XS8WpbYm7GE7/gsE5aDS1AfLNxAEYM26cupMsz8AW5WMO wXkUIMs9nM+P5RihDOIqz+1a3C1w+hh8tuakZqSkKHEby1/bXyMs04AIMJZ8YoCnjF qah+Gm+rvgnmw== Date: Thu, 26 May 2022 07:54:03 +0300 From: Jarkko Sakkinen To: Miguel Ojeda Cc: Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , linux-kernel , Boqun Feng , Kees Cook Subject: Re: [PATCH v7 01/25] kallsyms: avoid hardcoding the buffer size Message-ID: References: <20220523020209.11810-1-ojeda@kernel.org> <20220523020209.11810-2-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Tue, May 24, 2022 at 06:21:14PM +0200, Miguel Ojeda wrote: > On Mon, May 23, 2022 at 9:46 PM Jarkko Sakkinen wrote: > > > > "Declare KSY_NAME_LEN, which describes the maximum length for a kernel > > symbol read by kallsyms from the input. In read_symbol(), define the > > buffer to be of length "KSY_NAME_LEN + 1", which includes the terminator > > character." > > > > would be better. > > Note that the patch is not declaring `KSYM_NAME_LEN`, but a new > constant for a fairly arbitrarily sized for an input buffer. > > I am all for detailed commit messages, and I agree this can be > expanded. However, I think the first sentence of what you wrote should > be part of the docs of the constant, and the second one sounds like it > could be a comment on the code. Something like "Introduce > KSYM_NAME_LEN_BUFFER in place of the previously hardcoded size of the > input buffer (...)" would be better for a reviewer. Inline comment would be sufficient a remainder, and actually a better idea. > > You must split this then into two patches: > > Note that the size is not really being increased in a meaningful way > -- the important bit is the introduction of the relationship between > constants. The changes are all meant as a replacement for the > previously hardcoded constant, so I don't think the split is a "must", > but we can do it. > > We can even split this into 3 patches: clean up the unneeded `sizeof`, > replace (and, importantly, document) the hardcoded constant, and > finally introduce the relationship. > > Thanks for taking a look! > > Cheers, > Miguel BR, Jarkko