]> xenbits.xensource.com Git - xtf.git/commitdiff
Adjust XSA-221 PoC based on XSA-343 behaviour change
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Sep 2020 13:09:03 +0000 (14:09 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Sep 2020 13:09:03 +0000 (14:09 +0100)
XSA-343 has made SCHEDOP_poll fail for un-established event channels, which is
reasonable behaviour.  Don't bother trying to audit the error codes, and
always run to the end of the loop.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/xsa-221/main.c

index 499864082681be70fd32da6bec5af76ce5adbd20..66efe974d2dc034daf3a73a8ebc62c1a3d7ad2a7 100644 (file)
@@ -33,25 +33,7 @@ void test_main(void)
     };
 
     for ( port = 32; port <= 4096; ++port )
-    {
-        int rc = hypercall_sched_op(SCHEDOP_poll, &poll);
-
-        switch ( rc )
-        {
-        case 0:
-            continue;
-
-        case -EINVAL:
-            /* Upper ABI limit of 2l evtchn. */
-            if ( port == 4096 )
-                break;
-
-            /* Fallthrough. */
-        default:
-            return xtf_error("Error: Unexpected "
-                             "SCHEDOP_poll(port %u) return: %d\n", port, rc);
-        }
-    }
+        hypercall_sched_op(SCHEDOP_poll, &poll);
 
     /*
      * If Xen is still alive at this point, it hasn't fallen over a NULL