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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6DA2C433F5 for ; Tue, 24 May 2022 16:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239285AbiEXQVb (ORCPT ); Tue, 24 May 2022 12:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239419AbiEXQV3 (ORCPT ); Tue, 24 May 2022 12:21:29 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0571FB492; Tue, 24 May 2022 09:21:26 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id o16so12187351ilq.8; Tue, 24 May 2022 09:21:26 -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=LC2IXAGcmYuiteZpSiIXi00J39B1CEM53r26v/kTRJM=; b=MycnTkQhH+UxSrimwN12BB8TeOpX70Fq9HSbOTIJylR8wHkeAejpaS7Dm2NPvfA3SW POz0Ge9dHsexOR1LZR8jYvWaoxlCgsGqWZIED8pF2bp5HDSkO9uiZEtuidOVq5suRWPz XYkIqIhtEf8rzc3hPRU9j6ooGV7afl2IbZabN+zo+F6I7DxbOt+tgXitaCysCmaLAPc6 CnQZ6ka9ORT4ZQNImgRyVRnlsj4wZRShNxsuqaObrYONLvldfFLAMQ4bg8gVMyKlyyIs h5Onos6LsWuEHkvwL1ffKx9B/BunUXZAu5wkTfxA+RgTiaSYl1c/9VvtmyfyHIb8G1oP CIdw== 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=LC2IXAGcmYuiteZpSiIXi00J39B1CEM53r26v/kTRJM=; b=GDlCzvYxo89LmcaU+DTcommu7uFl4WR69T9Nf3jQpo9t6OEG/qjDUG4XSvCtv0GnbD A5ftaUVmgo2g9ry1wVwLiGUO3MDACMEgyewJ2RMZK5JRss52WTthrSU07a+9TrfiT8gZ dNiT+AfayvZ4EFTBfnT1WLzDv27cDrBdC+w7XmJ7rEPFMQKT37tvgGc13/9X+rSqSnz/ V2g3nqu8P+MxFcBT6RgW+i31k5jGCL+EY8So9PCC35NFr287e+Cl2KD68n5B8kHxj1fE duTAvu5fSSO+yPjBXxOe4MwHmioemJuZcf7kvjzYMJ3VUO688JMCnqnrtFv2Q7zmr1IH 77KA== X-Gm-Message-State: AOAM531u7OZnvtOk5Pr97Xh6+2l4hideJvxuFro6NWD4eEWtikNFfi86 T2aAPllGJR1ux+kQI60ZUZmHqn+kIK7U8vWZAoU= X-Google-Smtp-Source: ABdhPJwNQSKfUEC0s31c/Rr9/rNSNWE/ryUc80Ip9r8jglMdrY3NeJGsyCM/aWzJ5tw0gW9aXRlC9IcJXApIK+49uuw= X-Received: by 2002:a05:6e02:1c81:b0:2d1:3971:9343 with SMTP id w1-20020a056e021c8100b002d139719343mr14623732ill.237.1653409286022; Tue, 24 May 2022 09:21:26 -0700 (PDT) MIME-Version: 1.0 References: <20220523020209.11810-1-ojeda@kernel.org> <20220523020209.11810-2-ojeda@kernel.org> In-Reply-To: From: Miguel Ojeda Date: Tue, 24 May 2022 18:21:14 +0200 Message-ID: Subject: Re: [PATCH v7 01/25] kallsyms: avoid hardcoding the buffer size To: Jarkko Sakkinen Cc: Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , linux-kernel , Boqun Feng , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org 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. > 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