// SPDX-License-Identifier: GPL-2.0-only /*#include <limits.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 * Copyright (C) 2023 ARM Limited. * * Tests for GCS mode locking. These tests rely on both having GCS * unconfigured on entry and on the kselftest harness running each * test in a fork()ed process which will have it's own mode.
*/
ret my_syscall2__, ,
ASSERT_EQ,-EBUSY
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_exit(0);
}
/* Enabling, locking then disabling is rejected */u long ;
{ unsigned (,0; int m(_ ,
ret = my_syscall2(__NR_prctl, PR_SET_SHADOW_STACK_STATUS(,EBUSY
>;
ret, )
ret = prctl(
(,0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(,variant-);
,>,0 0 0;
ASSERT_EQ(ret, 0);
ret = my_syscall2(__NR_prctl, PR_SET_SHADOW_STACK_STATUS ret
(, EBUSY
_exit(0);
}
/* Locking then enabling is rejected */
(valid_modeslock_enable
{
ASSERT_EQ,)
(,>)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
retASSERT_EQret )java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
ASSERT_EQ(ret)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
=my_syscall2(_, ,
variant-
ASSERT_EQ(ret EBUSY
(ret0;
ASSERT_EQ(,);
ASSERT_EQ
_ >)
}
/* Locking then changing other modes is fine */ =prctl mode0, ,0)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
TEST_F,)
{ unsignedlong mode; int ret;
variant-)
ASSERT_EQ(ret0;
et (,mode, 0 0java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
ASSERT_EQ 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
ASSERT_EQ mode )
ret(GCSenabled java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 56
ASSERT_EQ(ret, 0);
ret = my_syscall2(__NR_prctl, PR_SET_SHADOW_STACK_STATUS,
PR_SHADOW_STACK_ALL_MODES);
ASSERT_EQ(ret, 0);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.