<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 3, 2020, 12:08 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03/01/2020 00:24, Gedare Bloom wrote:<br>
>     while ( !_Chain_Is_empty( &the_thread->Priority_node.Inherited_priorities ) ) {<br>
> +    _ISR_Disable( level );<br>
>       _Thread_Dequeue_priority_node(<br>
>         ((Thread_Priority_node*)_Chain_First(<br>
>           &the_thread->Priority_node.Inherited_priorities<br>
>         ))<br>
>       );<br>
> +    _ISR_Enable( level );<br>
>     }<br>
<br>
I don't know how the stuff works in detail, but this looks like a TOCTOU <br>
problem. Should this be changed into:<br>
<br>
_ISR_Disable( level );<br>
while ( !_Chain_Is_empty( <br>
&the_thread->Priority_node.Inherited_priorities ) ) {<br>
   _Thread_Dequeue_priority_node(<br>
     (Thread_Priority_node *) _Chain_First(<br>
       &the_thread->Priority_node.Inherited_priorities<br>
     )<br>
   );<br>
   _ISR_Flash( level );<br>
}<br>
_ISR_Enable( level );<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I think Sebastian is right. There is a small window.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : +49 89 189 47 41-16<br>
Fax     : +49 89 189 47 41-09<br>
E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank" rel="noreferrer">sebastian.huber@embedded-brains.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div></div>