Skip to content

Commit de11a67

Browse files
committed
Remove dynamic check failure test for check_range_doesnt_cross_app_sbx_boundary
1 parent 69306c5 commit de11a67

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

code/include/rlbox_range.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ inline void check_range_doesnt_cross_app_sbx_boundary(const void* ptr,
2424
auto ptr_start = reinterpret_cast<void*>(ptr_start_val);
2525
auto ptr_end = reinterpret_cast<void*>(ptr_end_val);
2626

27-
detail::dynamic_check(
28-
rlbox_sandbox<T_Sbx>::is_in_same_sandbox(ptr_start, ptr_end),
29-
"range has overflowed sandbox bounds");
27+
bool safe = rlbox_sandbox<T_Sbx>::is_in_same_sandbox(ptr_start, ptr_end);
28+
if (!safe) {
29+
printf("range has overflowed sandbox bounds: %p, %p\n", ptr_start, ptr_end);
30+
abort();
31+
}
3032
}
3133

3234
}

code/tests/rlbox/test_verification.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,3 @@ TEST_CASE("RLBox test unverified value", "[verification]")
108108
REQUIRE(result3 == testVal);
109109
}
110110

111-
// NOLINTNEXTLINE
112-
TEST_CASE("RLBox test unverified pointer", "[verification]")
113-
{
114-
rlbox::rlbox_sandbox<TestSandbox> sandbox;
115-
sandbox.create_sandbox();
116-
tainted<int*, TestSandbox> pa = sandbox.malloc_in_sandbox<int>();
117-
118-
const auto elementCountSafe = 1;
119-
REQUIRE_NOTHROW(pa.unverified_safe_pointer_because(elementCountSafe,
120-
"Reading within range"));
121-
122-
const auto elementCountUnsafe =
123-
(TestSandbox::SandboxMemorySize / sizeof(int)) + 1;
124-
REQUIRE_THROWS(pa.unverified_safe_pointer_because(
125-
elementCountUnsafe, "Definitely out of sandbox memory. Unsafe!"));
126-
127-
sandbox.destroy_sandbox();
128-
}

0 commit comments

Comments
 (0)