Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1747269rwb; Wed, 26 Jul 2023 18:31:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqw51+jhnMC+zZbDXLTj1hHugTC1+7Fy4xAW9G9CJm99V7ucEFkwqkqMPICw+uuBZCBxUT X-Received: by 2002:a17:90a:1f83:b0:263:2335:594e with SMTP id x3-20020a17090a1f8300b002632335594emr3444667pja.38.1690421495960; Wed, 26 Jul 2023 18:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690421495; cv=none; d=google.com; s=arc-20160816; b=IPH+dF7T4bnvOWYccT8dQM70iYO4PBj4A3evMVIvwyeoOMxUy5oSyzj/HgLJHG97sE 2chnaqyPLGMKe1Pm9qbG8iC3NGfD0hT09bDurfoaPEP6oFTR2li08LBvuSQf2h/9/8Kh TbYtEjW2GCp0uyJD/P92ve8NZUwYmDnbOUShDUKwnCW4TQAGkMmnrB0kRNp4epiekBZf LPqcBjoV4BlSFhUZnKzSKv4loPXW2xd4uW7CgDyk0dhzaJIt68YKKbvfpTnu/1kK+3Ob nLcKZCrBroUibcaWl7+q2QpzEuvkArSPtqGmB2/4GYa2u5mQMZKbA5/EQo0dMVq73wBn eSTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=6MweFbwGTkwMxODwdeAOszsWqbtjUfgPWc3MOlbKczw=; fh=ho27bri9lhrKI8jEBMydib5OAKCXv5Of5EFS/OKjtGY=; b=aj4NP5e6/OB/5veVuspFFuwLPDFDzFKrHO5HOVUQlBJv/xxi2QHyjUKXm/TwJNCWsm ViMjcHtFFQex40NQpXynsIo06IrSTkzL3fBLYuQMxz630h0dhmTggqRZWBtCxl74ICDm ruMMuih8RLGqQqVPzzhRsXbE/5zfy8QHksl0ps0T3oTyyqGUy2uJVyVhDuTcexI1fDDe cY6BO1gOF/k1hFSNNr9WrMlgN4COFfePM2X+s5Bgz4tkQfgc9tw+aA61unUM3KwWyeNM yjKHj7BKDhE4JB5m6YCnxPId8I3xGfGyMQxiHk3WzYG0AukBs33XVPHnHSH5mjQ3HUR0 STEg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a17090a974700b0024b011026aesi1912976pjw.76.2023.07.26.18.31.22; Wed, 26 Jul 2023 18:31:35 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbjG0BSV (ORCPT + 99 others); Wed, 26 Jul 2023 21:18:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbjG0BST (ORCPT ); Wed, 26 Jul 2023 21:18:19 -0400 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A8C3270D; Wed, 26 Jul 2023 18:18:16 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VoIPE.._1690420691; Received: from 30.221.136.121(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0VoIPE.._1690420691) by smtp.aliyun-inc.com; Thu, 27 Jul 2023 09:18:13 +0800 Message-ID: Date: Thu, 27 Jul 2023 09:18:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] ocfs2: Use regular seq_show_option for osb_cluster_stack Content-Language: en-US To: Kees Cook , Mark Fasheh , akpm Cc: Joel Becker , Andy Shevchenko , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20230726215919.never.127-kees@kernel.org> From: Joseph Qi In-Reply-To: <20230726215919.never.127-kees@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 7/27/23 5:59 AM, Kees Cook wrote: > While cleaning up seq_show_option_n()'s use of strncpy, it was noticed > that the osb_cluster_stack member is always NUL-terminated, so there is > no need to use the special seq_show_option_n() routine. Replace it with > the standard seq_show_option() routine. > > Cc: Mark Fasheh > Cc: Joel Becker > Cc: Joseph Qi > Cc: Andy Shevchenko > Cc: ocfs2-devel@lists.linux.dev > Signed-off-by: Kees Cook Looks good. Reviewed-by: Joseph Qi > --- > --- > fs/ocfs2/super.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c > index 988d1c076861..6b906424902b 100644 > --- a/fs/ocfs2/super.c > +++ b/fs/ocfs2/super.c > @@ -1517,8 +1517,7 @@ static int ocfs2_show_options(struct seq_file *s, struct dentry *root) > seq_printf(s, ",localflocks,"); > > if (osb->osb_cluster_stack[0]) > - seq_show_option_n(s, "cluster_stack", osb->osb_cluster_stack, > - OCFS2_STACK_LABEL_LEN); > + seq_show_option(s, "cluster_stack", osb->osb_cluster_stack); > if (opts & OCFS2_MOUNT_USRQUOTA) > seq_printf(s, ",usrquota"); > if (opts & OCFS2_MOUNT_GRPQUOTA)