Calling a timer's expiry method may cause arbitrary consequences, including arbitrary modifications of the list of retry timers. list_for_each_entry_safe() guards against only deletion of the current list entry; it provides no protection against other list modifications. In particular, if a timer's expiry method causes the subsequent timer in the list to be deleted, then the next loop iteration will access a timer that may no longer exist. This is a particularly nasty bug, since absolutely none of the list-manipulation or reference-counting assertion checks will be triggered. (The first assertion failure happens on the next iteration through list_for_each_entry(), showing that the list has become corrupted but providing no clue as to when this happened.) Fix by stopping traversal of the list of retry timers as soon as we hit an expired timer. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
180 |
|
180 |
|
181 |
|
181 |
|
182 |
|
182 |
|
183 |
|
|
|
184 |
|
183 |
|
185 |
|
184 |
|
186 |
|
185 |
|
187 |
|
|
|
|
186 |
|
|
|
187 |
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
|
|
|
191 |
|
|
188 |
|
192 |
|
189 |
|
|
|
|
193 |
|
|
190 |
|
194 |
|
|
195 |
|
|
|
196 |
|
|
191 |
|
197 |
|
192 |
|
198 |
|
193 |
|
199 |
|