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

JC Beyler jcbeyler at google.com
Mon Oct 1 16:43:08 UTC 2018


Hi,

Should we not be also incrementing i to get the next Ace? Otherwise, we are
always getting the same one and probably just waiting till the count is 0
which would terminate the loop (if that is what we want, why not just
break?).

Thanks,
Jc

On Mon, Oct 1, 2018 at 4:57 PM Jonathan Gibbons <jonathan.gibbons at oracle.com>
wrote:

> 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
>
>
>
>
>
>
>

-- 

Thanks,
Jc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20181001/cd39dc5f/attachment.html>


More information about the serviceability-dev mailing list