Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383361

Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access in enqueue_task_dl()

From Xunlei Pang <xpang@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access in enqueue_task_dl()
Date 2016-04-20 15:10 +0200
Message-ID <rq03g-8ot-21@gated-at.bofh.it> (permalink)
References (1 earlier) <rnNMS-Ww-27@gated-at.bofh.it> <rnRx7-408-9@gated-at.bofh.it> <ro1d8-3iG-5@gated-at.bofh.it> <ro1wt-3Ok-1@gated-at.bofh.it> <rpZqz-7Qn-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/04/20/ at 20:25, Peter Zijlstra wrote:
> On Fri, Apr 15, 2016 at 10:19:12AM +0800, Xunlei Pang wrote:
>> On 2016/04/15 at 09:58, Xunlei Pang wrote:
>>> On 2016/04/14 at 23:31, Peter Zijlstra wrote:
>>>> On Thu, Apr 14, 2016 at 07:37:06PM +0800, Xunlei Pang wrote:
>>>>> We access @pi_task's data without any lock in enqueue_task_dl(), though
>>>>> checked "dl_prio(pi_task->normal_prio)" condition, that's not enough.
>>>> The proper fix is to ensure that pi_task is guaranteed to be blocked.
>>> Even if pi_task was blocked, its parameters are still allowed to be changed,
>>> so we have to do that. Did I miss something?
>>>
>>> Regards,
>>> Xunlei
>> Fortunately, I just reproduced through an overnight test, so it really happened in reality as I thought.
> But what happens? How is it changed when it is blocked?

The top waiter's policy can be changed by other tasks through sched_setattr() syscall during it was blocked.
I created another thread doing the following thing:
     while (1) {
        change the waiter to cfs
        do something
        change the waiter to deadline
    }

Regards,
Xunlei

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 14:30 +0200
  Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Xunlei Pang <xpang@redhat.com> - 2016-04-20 15:10 +0200
    Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 15:20 +0200
      Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access  in enqueue_task_dl() Xunlei Pang <xpang@redhat.com> - 2016-04-20 15:50 +0200

csiph-web