Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241224094543.GE10433@brightrain.aerifal.cx>
Date: Tue, 24 Dec 2024 04:45:43 -0500
From: Rich Felker <dalias@...c.org>
To: yan.li.cn@...driver.com
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] add check for pthread_attr_setschedpolicy

On Tue, Dec 24, 2024 at 03:06:23PM +0800, yan.li.cn@...driver.com wrote:
> From: Yan Li <yan.li.cn@...driver.com>
> 
> ---
>  src/thread/pthread_attr_setschedpolicy.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 src/thread/pthread_attr_setschedpolicy.c
> 
> diff --git a/src/thread/pthread_attr_setschedpolicy.c b/src/thread/pthread_attr_setschedpolicy.c
> old mode 100644
> new mode 100755
> index bb71f393..f943e3c5
> --- a/src/thread/pthread_attr_setschedpolicy.c
> +++ b/src/thread/pthread_attr_setschedpolicy.c
> @@ -2,6 +2,10 @@
>  
>  int pthread_attr_setschedpolicy(pthread_attr_t *a, int policy)
>  {
> -	a->_a_policy = policy;
> -	return 0;
> +    if (policy != SCHED_OTHER && policy != SCHED_FIFO && policy != SCHED_RR){
> +        return EINVAL;
> +    }
> +
> +    a->_a_policy = policy;
> +    return 0;
>  }
> -- 
> 2.34.1

This is also a MAY FAIL condition, and as written it breaks support for
all of the Linux-extension scheduling policies. Even if you included
all of those, it would break running newer binaries using a
newly-added policy with an older libc.so.

Aside: It seems either you've replaced tabs with 4 spaces or your mail
software is corrupting the patches you send. Please use tabs for
indention and if your mailer can't guarantee they make it through
intact, attach them as MIME attachments.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.