Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3369406ioa; Tue, 26 Apr 2022 02:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXVb8USDjvMZpIvFa/HUgN65uj/zh0P0rs6NtZfk+XBEH3+bWsyrDB71wqv/S+Jp1O4wps X-Received: by 2002:a17:907:da7:b0:6df:9ff4:10c7 with SMTP id go39-20020a1709070da700b006df9ff410c7mr19788781ejc.106.1650964092701; Tue, 26 Apr 2022 02:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650964092; cv=none; d=google.com; s=arc-20160816; b=evYKs6BAP56nuV1FZ7lRZR2kNZOJS70BnekZFGiPRMoovh6YamrB1ivaGYA77aZAJq x1NiqQmHBHcRkGCfM+V1LeVHnhhWLgve7n+YVFNUmZqTKDikHc6zrnvPEp0rQTiLobmT 9dTfPuax5jPgxY8Em3KuCVp0q2a2S664MBtVtf7gUn1Clrgh2gIDwpS6VuuyPtRQuCH7 hDXhihrZZn3lzh+INzGKZJwidOT3oa8f3xVSKg6q+FY+P1k0MktanomeHllC/BlqmHlN uqz6flfkHtO1eHmqfeWddzKRlbVnWnByBZF8tgNYV2D4QDqDLyaUZw5zIxh0/g+PYznZ W8ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=UezYTpkGwwWHLr7TCtI1U2DaUhIahmheDQtz2U252E8=; b=CfHDBEUMuAK+hn5sM1de2xoERHDnUdPvuEBk/FeZll0ft5IoXiTjCR8JKKUTT1aLSI rJ5/uRL6v+DrEM2+rZxZ1ZgDeo8UTrVps9DlhCO25jPmPog1cp+syv+Vv9aGa/Qgj0xn ijkQUYW79rJxiIgnPoLaGUFvkYAHIzSJn179gd/ISPPhyYsgCDt97bAFVRvmAoqCuGdd Fh+c8bnR9/zdJBNBhr8spQKZTAl1X4QTgmspV8Uwqw/xq83WlFdxFDpraahavpIpbBgK oyFC/yXx1YaoIJC+UjYIM9ekYA+8IFHMgT/EPKx2eApNIXmqkmejG0dQdwCSOKaDn7u7 4HAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Aiubjeiy; 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 m5-20020a17090679c500b006f38560fe61si6524406ejo.94.2022.04.26.02.07.47; Tue, 26 Apr 2022 02:08:12 -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=@infradead.org header.s=bombadil.20210309 header.b=Aiubjeiy; 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 S245126AbiDYUzE (ORCPT + 99 others); Mon, 25 Apr 2022 16:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231753AbiDYUzC (ORCPT ); Mon, 25 Apr 2022 16:55:02 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DDD344C4; Mon, 25 Apr 2022 13:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UezYTpkGwwWHLr7TCtI1U2DaUhIahmheDQtz2U252E8=; b=AiubjeiyEAbQT1rdssolc9+eZK naeZMgkl43Z0EmDFbEoCYDmvpiO4T72GaML9jlCS+eBzGNwOKFluO2V07O5H9zyulLE72HREp993g EXbExZH1WBQbZ6NXNeSd/EgfIObs2hEz6ebhZ/YY6iBd1FPKu2Xs/RzlDZuJ86EpubGQLJeCVZybG ENn1LZgUp/3ycXHGzA2iHKMOOoc/Sa5Yv3jKfTBNfLU7fGO4i+abaRcpsCln6CyOEXtzy+QpodVaY DOIlS+GDlzsu0zNAtfWtFNkX+xNHdZrsII3emTPOXAeCcbJMF9nncvshtVS3p+oJmFpWZtWyTiYU2 I2JvPTvg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj5gb-00BOQb-7n; Mon, 25 Apr 2022 20:51:57 +0000 Date: Mon, 25 Apr 2022 13:51:57 -0700 From: Luis Chamberlain To: Vasily Averin Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Iurii Zaikin , kernel@openvz.org Subject: Re: [PATCH] sysctl: minor cleanup in new_dir() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 Sun, Apr 24, 2022 at 09:28:54PM +0300, Vasily Averin wrote: > Byte zeroing is not required here, since memory was allocated by kzalloc() > > Signed-off-by: Vasily Averin > --- > fs/proc/proc_sysctl.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c > index 7d9cfc730bd4..094c24e010ae 100644 > --- a/fs/proc/proc_sysctl.c > +++ b/fs/proc/proc_sysctl.c > @@ -978,7 +978,6 @@ static struct ctl_dir *new_dir(struct ctl_table_set *set, > table = (struct ctl_table *)(node + 1); > new_name = (char *)(table + 2); > memcpy(new_name, name, namelen); > - new_name[namelen] = '\0'; > table[0].procname = new_name; > table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; > init_header(&new->header, set->dir.header.root, set, node, table); Queued onto sysctl-testing, thanks! Luis