Commit f1583cb1 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'linux-kselftest-next-5.15-rc1' of...

Merge tag 'linux-kselftest-next-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest updates from Shuah Khan:
 "Fixes to build and test failures:

   - openat2 test failure for O_LARGEFILE flag on ARM64

   - x86 test build failures related to glibc 2.34 adding support for
     variable sized MINSIGSTKSZ and SIGSTKSZ

   - removing obsolete configs in sync and cpufreq config files

   - minor spelling and duplicate header include cleanups"

* tag 'linux-kselftest-next-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/cpufreq: Rename DEBUG_PI_LIST to DEBUG_PLIST
  selftests/sync: Remove the deprecated config SYNC
  selftests: safesetid: Fix spelling mistake "cant" -> "can't"
  selftests/x86: Fix error: variably modified 'altstack_data' at file scope
  kselftest:sched: remove duplicate include in cs_prctl_test.c
  selftests: openat2: Fix testing failure for O_LARGEFILE flag
parents b250e6d1 67d6d80d
...@@ -6,7 +6,7 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y ...@@ -6,7 +6,7 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_DEBUG_RT_MUTEXES=y CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y CONFIG_DEBUG_PLIST=y
CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_DEBUG_LOCK_ALLOC=y
......
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
* XXX: This is wrong on {mips, parisc, powerpc, sparc}. * XXX: This is wrong on {mips, parisc, powerpc, sparc}.
*/ */
#undef O_LARGEFILE #undef O_LARGEFILE
#ifdef __aarch64__
#define O_LARGEFILE 0x20000
#else
#define O_LARGEFILE 0x8000 #define O_LARGEFILE 0x8000
#endif
struct open_how_ext { struct open_how_ext {
struct open_how inner; struct open_how inner;
......
...@@ -152,7 +152,7 @@ static void write_policies(void) ...@@ -152,7 +152,7 @@ static void write_policies(void)
fd = open(add_whitelist_policy_file, O_WRONLY); fd = open(add_whitelist_policy_file, O_WRONLY);
if (fd < 0) if (fd < 0)
die("cant open add_whitelist_policy file\n"); die("can't open add_whitelist_policy file\n");
written = write(fd, policy_str, strlen(policy_str)); written = write(fd, policy_str, strlen(policy_str));
if (written != strlen(policy_str)) { if (written != strlen(policy_str)) {
if (written >= 0) { if (written >= 0) {
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
......
CONFIG_STAGING=y CONFIG_STAGING=y
CONFIG_ANDROID=y CONFIG_ANDROID=y
CONFIG_SYNC=y
CONFIG_SW_SYNC=y CONFIG_SW_SYNC=y
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
unsigned short ss; unsigned short ss;
extern unsigned char breakpoint_insn[]; extern unsigned char breakpoint_insn[];
sigjmp_buf jmpbuf; sigjmp_buf jmpbuf;
static unsigned char altstack_data[SIGSTKSZ];
static void enable_watchpoint(void) static void enable_watchpoint(void)
{ {
...@@ -250,13 +249,14 @@ int main() ...@@ -250,13 +249,14 @@ int main()
if (sigsetjmp(jmpbuf, 1) == 0) { if (sigsetjmp(jmpbuf, 1) == 0) {
printf("[RUN]\tMOV SS; SYSENTER\n"); printf("[RUN]\tMOV SS; SYSENTER\n");
stack_t stack = { stack_t stack = {
.ss_sp = altstack_data, .ss_sp = malloc(sizeof(char) * SIGSTKSZ),
.ss_size = SIGSTKSZ, .ss_size = SIGSTKSZ,
}; };
if (sigaltstack(&stack, NULL) != 0) if (sigaltstack(&stack, NULL) != 0)
err(1, "sigaltstack"); err(1, "sigaltstack");
sethandler(SIGSEGV, handle_and_longjmp, SA_RESETHAND | SA_ONSTACK); sethandler(SIGSEGV, handle_and_longjmp, SA_RESETHAND | SA_ONSTACK);
nr = SYS_getpid; nr = SYS_getpid;
free(stack.ss_sp);
/* Clear EBP first to make sure we segfault cleanly. */ /* Clear EBP first to make sure we segfault cleanly. */
asm volatile ("xorl %%ebp, %%ebp; mov %[ss], %%ss; SYSENTER" : "+a" (nr) asm volatile ("xorl %%ebp, %%ebp; mov %[ss], %%ss; SYSENTER" : "+a" (nr)
: [ss] "m" (ss) : "flags", "rcx" : [ss] "m" (ss) : "flags", "rcx"
......
...@@ -138,9 +138,6 @@ static unsigned short LDT3(int idx) ...@@ -138,9 +138,6 @@ static unsigned short LDT3(int idx)
return (idx << 3) | 7; return (idx << 3) | 7;
} }
/* Our sigaltstack scratch space. */
static char altstack_data[SIGSTKSZ];
static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *),
int flags) int flags)
{ {
...@@ -771,7 +768,8 @@ int main() ...@@ -771,7 +768,8 @@ int main()
setup_ldt(); setup_ldt();
stack_t stack = { stack_t stack = {
.ss_sp = altstack_data, /* Our sigaltstack scratch space. */
.ss_sp = malloc(sizeof(char) * SIGSTKSZ),
.ss_size = SIGSTKSZ, .ss_size = SIGSTKSZ,
}; };
if (sigaltstack(&stack, NULL) != 0) if (sigaltstack(&stack, NULL) != 0)
...@@ -872,5 +870,6 @@ int main() ...@@ -872,5 +870,6 @@ int main()
total_nerrs += test_nonstrict_ss(); total_nerrs += test_nonstrict_ss();
#endif #endif
free(stack.ss_sp);
return total_nerrs ? 1 : 0; return total_nerrs ? 1 : 0;
} }
...@@ -57,7 +57,6 @@ static void clearhandler(int sig) ...@@ -57,7 +57,6 @@ static void clearhandler(int sig)
static volatile sig_atomic_t sig_traps, sig_eflags; static volatile sig_atomic_t sig_traps, sig_eflags;
sigjmp_buf jmpbuf; sigjmp_buf jmpbuf;
static unsigned char altstack_data[SIGSTKSZ];
#ifdef __x86_64__ #ifdef __x86_64__
# define REG_IP REG_RIP # define REG_IP REG_RIP
...@@ -210,7 +209,7 @@ int main() ...@@ -210,7 +209,7 @@ int main()
unsigned long nr = SYS_getpid; unsigned long nr = SYS_getpid;
printf("[RUN]\tSet TF and check SYSENTER\n"); printf("[RUN]\tSet TF and check SYSENTER\n");
stack_t stack = { stack_t stack = {
.ss_sp = altstack_data, .ss_sp = malloc(sizeof(char) * SIGSTKSZ),
.ss_size = SIGSTKSZ, .ss_size = SIGSTKSZ,
}; };
if (sigaltstack(&stack, NULL) != 0) if (sigaltstack(&stack, NULL) != 0)
...@@ -219,6 +218,7 @@ int main() ...@@ -219,6 +218,7 @@ int main()
SA_RESETHAND | SA_ONSTACK); SA_RESETHAND | SA_ONSTACK);
sethandler(SIGILL, print_and_longjmp, SA_RESETHAND); sethandler(SIGILL, print_and_longjmp, SA_RESETHAND);
set_eflags(get_eflags() | X86_EFLAGS_TF); set_eflags(get_eflags() | X86_EFLAGS_TF);
free(stack.ss_sp);
/* Clear EBP first to make sure we segfault cleanly. */ /* Clear EBP first to make sure we segfault cleanly. */
asm volatile ("xorl %%ebp, %%ebp; SYSENTER" : "+a" (nr) :: "flags", "rcx" asm volatile ("xorl %%ebp, %%ebp; SYSENTER" : "+a" (nr) :: "flags", "rcx"
#ifdef __x86_64__ #ifdef __x86_64__
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#include "helpers.h" #include "helpers.h"
/* Our sigaltstack scratch space. */
static unsigned char altstack_data[SIGSTKSZ];
static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *), static void sethandler(int sig, void (*handler)(int, siginfo_t *, void *),
int flags) int flags)
{ {
...@@ -104,7 +101,8 @@ static void sigill(int sig, siginfo_t *info, void *ctx_void) ...@@ -104,7 +101,8 @@ static void sigill(int sig, siginfo_t *info, void *ctx_void)
int main() int main()
{ {
stack_t stack = { stack_t stack = {
.ss_sp = altstack_data, /* Our sigaltstack scratch space. */
.ss_sp = malloc(sizeof(char) * SIGSTKSZ),
.ss_size = SIGSTKSZ, .ss_size = SIGSTKSZ,
}; };
if (sigaltstack(&stack, NULL) != 0) if (sigaltstack(&stack, NULL) != 0)
...@@ -233,5 +231,6 @@ int main() ...@@ -233,5 +231,6 @@ int main()
set_eflags(get_eflags() & ~X86_EFLAGS_TF); set_eflags(get_eflags() & ~X86_EFLAGS_TF);
#endif #endif
free(stack.ss_sp);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment