Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200522022628.GP1079@brightrain.aerifal.cx>
Date: Thu, 21 May 2020 22:26:29 -0400
From: "dalias@...ifal.cx" <dalias@...ifal.cx>
To: tangyizhou <tangyizhou@...wei.com>
Cc: "musl@...ts.openwall.com" <musl@...ts.openwall.com>,
	"Wanghui (John)" <john.wanghui@...wei.com>,
	"Huangshuai (OSLab)" <elvis.huang@...wei.com>
Subject: Re: Fix the return value of pthread_getschedparam in musl libc

On Fri, May 22, 2020 at 01:53:02AM +0000, tangyizhou wrote:
> > What is the situation under which SYS_sched_getparam can succeed
> > but SYS_sched_getscheduler can fail? The Linux man page
> > documenting the syscall:
> 
> There is a timing issue between two syscalls. Think about a concurrent scenario:
> Thread A calls pthread_getschedparam() to query the information of
> thread B.. After SYS_sched_getparam succeeds and before
> SYS_sched_getscheduler starts, thread B is killed, then
> SYS_sched_getparam returns -ESRCH.

There's not such an issue. t->killlock is held so that this can't
happen, and more importantly, so that the thread can't exit and the
tid be reassigned to a new thread or process that would wrongly be
acted upon.

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.