From patchwork Wed May 17 02:59:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Cruz X-Patchwork-Id: 69499 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A83FA3857004 for ; Wed, 17 May 2023 02:59:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A83FA3857004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684292389; bh=dmGUMh84bNsg1e6zDTo6u67zp3aJ/rFXvi1Hx08kQ4M=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Iq5CCYHVM/MEh2h1og2lBNr7xF240pMqSl66B5EPUPrVa8YVwom157KJYNc6GqDRd ZhorZjK8nCYcJSuSYEobaw38ORJdlOPGiUhPN//sqVuJ8i8j9cbwL9uqyjhtIX27Af SBtGo7RssmzDJMJMWyqSonXvzx3nSI8WUdYei0Go= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by sourceware.org (Postfix) with ESMTPS id 565CA3858D1E for ; Wed, 17 May 2023 02:59:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 565CA3858D1E Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-55a64f0053fso1830707b3.3 for ; Tue, 16 May 2023 19:59:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684292366; x=1686884366; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dmGUMh84bNsg1e6zDTo6u67zp3aJ/rFXvi1Hx08kQ4M=; b=L17VSzT4xLvuQrFeE+XpMqEq/zsa/1jsIo3xmDLRaY/Qb8kzk0gCoEKUJS6xNxE2Ak amhHaXyyHsSSXFVQbCrMOS5kpPzR5DZjaXlHpgKEvTLFJ5bj0rIGP58+I03t57kzSZ87 GhzqQDsBhdpFAMT3F8pm3J9ZEb+mD4vkh7NSwsYz5VVu+nAkMqFUVUi2LQ7hPBlHC8yj /uuR8fEqe9bcIcGFasn6KZMBTRQKrFrlWxYeClgfIKFxWHp8a5oN2RTVmsALCLKKnqlC di9L+UdfVAjmj1EwPWPN67bcc6TH+yXhhE6i+Z5FmrHA+0RSKQS5wvnsM6J7gIU+ZeGs OT8w== X-Gm-Message-State: AC+VfDzliQKMqXSeIJsI4SpliLREYcdiyDRFDuN7nVoVsm5FGUUu2dEx kS6FNNVNPoRiA4ouEGAXhg== X-Google-Smtp-Source: ACHHUZ4xvEpkXMcckeAkNRM+0HDg4n8yR+mIBaaBZcgZ6YsKpuVoF67q4O0I0iz+1Ne1V282FW9huw== X-Received: by 2002:a0d:de45:0:b0:561:8894:1e0e with SMTP id h66-20020a0dde45000000b0056188941e0emr3714269ywe.50.1684292366445; Tue, 16 May 2023 19:59:26 -0700 (PDT) Received: from jupiter.tail36e24.ts.net (dynamic-acs-24-154-253-225.zoominternet.net. [24.154.253.225]) by smtp.gmail.com with ESMTPSA id j201-20020a8192d2000000b0055a2cda24acsm361031ywg.35.2023.05.16.19.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 19:59:26 -0700 (PDT) Date: Tue, 16 May 2023 22:59:24 -0400 To: bug-hurd@gnu.org, libc-alpha@sourceware.org Cc: samuel.thibault@gnu.org Subject: [PATCH glibc] Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with TASK_THREAD_TIMES_INFO Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, 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 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-Patchwork-Original-From: Flavio Cruz via Libc-alpha From: Flavio Cruz Reply-To: Flavio Cruz Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This hasn't caused any problems yet but we are passing a pointer to struct task_thread_times_info which can cause problems if we populate over the existing size of the struct. --- sysdeps/mach/clock_gettime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c index cc8c821a7f..be775ed2bb 100644 --- a/sysdeps/mach/clock_gettime.c +++ b/sysdeps/mach/clock_gettime.c @@ -62,7 +62,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts) time_value_add (&t, &bi.system_time); /* Live threads CPU time. */ - count = TASK_EVENTS_INFO_COUNT; + count = TASK_THREAD_TIMES_INFO_COUNT; err = __task_info (__mach_task_self (), TASK_THREAD_TIMES_INFO, (task_info_t) &tti, &count); if (err)