blob: c261a77a32f6a8c416cb51058d24db6ff0ef7570 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
* Copyright (C) 2005 Jeff Dike (jdike@karaya.com)
*/
#ifndef __STUB_DATA_H
#define __STUB_DATA_H
#include <linux/compiler_types.h>
#include <as-layout.h>
#include <sysdep/tls.h>
#include <sysdep/stub-data.h>
#include <mm_id.h>
#define FUTEX_IN_CHILD 0
#define FUTEX_IN_KERN 1
struct stub_init_data {
int seccomp;
unsigned long stub_start;
int stub_code_fd;
unsigned long stub_code_offset;
int stub_data_fd;
unsigned long stub_data_offset;
unsigned long signal_handler;
unsigned long signal_restorer;
};
#define STUB_NEXT_SYSCALL(s) \
((struct stub_syscall *) (((unsigned long) s) + (s)->cmd_len))
enum stub_syscall_type {
STUB_SYSCALL_UNSET = 0,
STUB_SYSCALL_MMAP,
STUB_SYSCALL_MUNMAP,
};
struct stub_syscall {
struct {
unsigned long addr;
unsigned long length;
unsigned long offset;
int fd;
int prot;
} mem;
enum stub_syscall_type syscall;
};
struct stub_data {
unsigned long offset;
long err, child_err;
int syscall_data_len;
/* 128 leaves enough room for additional fields in the struct */
struct stub_syscall syscall_data[(UM_KERN_PAGE_SIZE - 128) / sizeof(struct stub_syscall)] __aligned(16);
/* data shared with signal handler (only used in seccomp mode) */
short restart_wait;
unsigned int futex;
int signal;
unsigned short si_offset;
unsigned short mctx_offset;
/* seccomp architecture specific state restore */
struct stub_data_arch arch_data;
/* Stack for our signal handlers and for calling into . */
unsigned char sigstack[UM_KERN_PAGE_SIZE] __aligned(UM_KERN_PAGE_SIZE);
};
#endif
|