From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id 56216385840B for ; Tue, 1 Feb 2022 22:22:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56216385840B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id BF6B972C8FA for ; Wed, 2 Feb 2022 01:22:40 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id A8D1F7CCAAC; Wed, 2 Feb 2022 01:22:40 +0300 (MSK) Date: Wed, 2 Feb 2022 01:22:40 +0300 From: "Dmitry V. Levin" To: Gleb Fotengauer-Malinovskiy Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850] Message-ID: <20220201222239.GB6227@altlinux.org> References: <20220201215644.473902-1-glebfm@altlinux.org> <20220201221407.500964-1-glebfm@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220201221407.500964-1-glebfm@altlinux.org> X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2022 22:22:42 -0000 On Tue, Feb 01, 2022 at 10:14:07PM +0000, Gleb Fotengauer-Malinovskiy wrote: > --- > sysdeps/unix/sysv/linux/getsysstats.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c > index 4798cc337e..b0a7663f56 100644 > --- a/sysdeps/unix/sysv/linux/getsysstats.c > +++ b/sysdeps/unix/sysv/linux/getsysstats.c > @@ -41,6 +41,7 @@ __get_nprocs_sched (void) > > /* This cannot use malloc because it is used on malloc initialization. */ > __cpu_mask cpu_bits[cpu_bits_size / sizeof (__cpu_mask)]; > + CPU_ZERO_S (cpu_bits_size, (cpu_set_t*) cpu_bits); > int r = INTERNAL_SYSCALL_CALL (sched_getaffinity, 0, cpu_bits_size, > cpu_bits); > if (r > 0) Fixes: 33099d72e41c ("linux: Simplify get_nprocs") Reviewed-by: Dmitry V. Levin -- ldv