From 43bbfd29bbe725e848489c9193e1adbf8781c2db Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 21 Jul 2021 23:56:28 -0700 Subject: [PATCH] kern: fix inverted condition in context breakpoint validation --- libraries/libmesosphere/source/arch/arm64/kern_k_debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libmesosphere/source/arch/arm64/kern_k_debug.cpp b/libraries/libmesosphere/source/arch/arm64/kern_k_debug.cpp index 8cfacac4c..40f595854 100644 --- a/libraries/libmesosphere/source/arch/arm64/kern_k_debug.cpp +++ b/libraries/libmesosphere/source/arch/arm64/kern_k_debug.cpp @@ -297,7 +297,7 @@ namespace ams::kern::arch::arm64 { /* If the breakpoint matches context id, we need to get the context id. */ if ((flags & (1ul << 21)) != 0) { /* Ensure that the breakpoint is context-aware. */ - R_UNLESS((name - ams::svc::HardwareBreakPointRegisterName_I0) <= (num_bp - num_ctx), svc::ResultNotSupported()); + R_UNLESS((name - ams::svc::HardwareBreakPointRegisterName_I0) >= (num_bp - num_ctx), svc::ResultNotSupported()); /* Check that the breakpoint does not have the mismatch bit. */ R_UNLESS((flags & (1ul << 22)) == 0, svc::ResultInvalidCombination());