Infinite loop in jdk/test/sun/management/windows/revokeall

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Infinite loop in jdk/test/sun/management/windows/revokeall

Ladislav Jahoda
Hello guys,
 
the revokeall utility has an infinite loop in its revokeAll method. Please note in the loop (line #344 in revokeall.c):
 
while (count > 0) {
 
the condition (line #354):
 
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceType != ACCESS_ALLOWED_ACE_TYPE) {
     continue;
}
 
which loops forever if the condition is met. Note that the “count” counter needs to be decremented before the continue statement, that is:
 
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceType != ACCESS_ALLOWED_ACE_TYPE) {
     count--;
     continue;
}
 
I checked the OpenJDK 8, 9 and 10, the bug is in all versions.
 
Thanks ahead for the fix,
Lada Jahoda
 

 
 
Reply | Threaded
Open this post in threaded view
|

Re: Infinite loop in jdk/test/sun/management/windows/revokeall

Jonathan Gibbons

I'm guessing serviceability-dev is a better place for this message.

-- Jon



On 10/1/18 5:44 AM, Ladislav Jahoda wrote:
Hello guys,
 
the revokeall utility has an infinite loop in its revokeAll method. Please note in the loop (line #344 in revokeall.c):
 
while (count > 0) {
 
the condition (line #354):
 
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceType != ACCESS_ALLOWED_ACE_TYPE) {
     continue;
}
 
which loops forever if the condition is met. Note that the “count” counter needs to be decremented before the continue statement, that is:
 
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceType != ACCESS_ALLOWED_ACE_TYPE) {
     count--;
     continue;
}
 
I checked the OpenJDK 8, 9 and 10, the bug is in all versions.
 
Thanks ahead for the fix,
Lada Jahoda