public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH glibc] Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with TASK_THREAD_TIMES_INFO
@ 2023-05-17  2:59 Flavio Cruz
  2023-05-17 17:23 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Flavio Cruz @ 2023-05-17  2:59 UTC (permalink / raw)
  To: bug-hurd, libc-alpha; +Cc: samuel.thibault

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)
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH glibc] Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with TASK_THREAD_TIMES_INFO
  2023-05-17  2:59 [PATCH glibc] Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with TASK_THREAD_TIMES_INFO Flavio Cruz
@ 2023-05-17 17:23 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2023-05-17 17:23 UTC (permalink / raw)
  To: Flavio Cruz; +Cc: bug-hurd, libc-alpha

Applied, thanks!

Flavio Cruz, le mar. 16 mai 2023 22:59:24 -0400, a ecrit:
> 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)
> -- 
> 2.39.2
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-17 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17  2:59 [PATCH glibc] Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with TASK_THREAD_TIMES_INFO Flavio Cruz
2023-05-17 17:23 ` Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).