Commit Graph

66 Commits

Author SHA1 Message Date
NAKAMURA Gou
39a86fad18 support execute disabled stack 2014-04-11 14:59:47 +09:00
NAKAMURA Gou
da81cd2d1d mcexec: copy a pathname string of open(2) safely
When a open system call request is delegated, mcexec will check whether
a path name is known one such as "/proc/meminfo" and "/proc/cpuinfo".
During this check, if mcexec causes a SIGSEGV or SIGBUS signal,
mcexec will begin a loop, because mcexec has a signal handler which
returns simply.
2014-04-03 15:27:49 +09:00
Balazs Gerofi bgerofi@riken.jp
cf442e6a14 fork(): preliminary version (no wait()/waitpid() support yet) 2014-04-02 14:07:38 +09:00
Balazs Gerofi bgerofi@riken.jp
391b69e8c4 refactor mcexec's main and separate signal and syscall thread initialization 2014-04-02 14:04:55 +09:00
Balazs Gerofi bgerofi@riken.jp
ccd770ba24 use per-process wait queues for system call request processing in mcexec so that multiple processes can share the per-core system call channels 2014-03-27 19:31:42 +09:00
Balazs Gerofi bgerofi@riken.jp
51f75d9ba8 mcexec: options for target CPU core ID where application is executed 2014-03-27 14:58:26 +09:00
Tomoki Shirasawa
74339586d5 change dma_buf size 256MB -> 4kB 2014-02-07 10:57:50 +09:00
NAKAMURA Gou
fcbaa9726c correct the syscall return type
Long size syscall return values such as shmat()'s and lseek()'s are
broken, because lower 32 bits are only returned.
2014-02-05 11:30:57 +09:00
NAKAMURA Gou
bdc945cb34 mcexec: wait for the signal to be received
The mcexec may send a signal to itself in order that the mcexec
terminates abnormally.
Generally, the signal is delivered to the thread which sent the signal.
In this case, the signal terminates the mcexec immediately.

However, if the signal is delivered to another thread,
the thread which sent the signal can call exit(3)
before the signal terminates the mcexec.
2014-01-24 20:22:54 +09:00
NAKAMURA Gou
069bb10a02 make mcexec ignore garbage request
When a signal is forwarded from McKernel,
ioctl(MCEXEC_UP_WAIT_SYSCALL) may return EINTR error.
In this case, though no syscall request has been received,
the mcexec starts to process the syscall requst that is garbage.
2014-01-24 20:20:45 +09:00
NAKAMURA Gou
c421965542 relocate a program interpreter to the map_start
This commit makes a system call that dereferences a NULL pointer fail.
2014-01-14 18:55:16 +09:00
NAKAMURA Gou
6992b829a0 delegate the open(2) with the generic forwarding.
This commit solves a problem that causes getpwnam()/getpwuid() to return
NULL.
2014-01-14 18:50:20 +09:00
NAKAMURA Gou
afc38718a0 add MCEXEC_UP_STRNCPY_FROM_USER
It allows a mcexec to execute the strncpy_from_user().
2014-01-14 18:50:19 +09:00
Tomoki Shirasawa
a8c249ddaf signal (part 1) 2014-01-07 11:57:57 +09:00
Tomoki Shirasawa
9926d469d8 remove debug print 2013-12-18 15:33:37 +09:00
Tomoki Shirasawa
96576aaee7 fix general protection fault caused by SIGALARM 2013-12-16 13:45:45 +09:00
Tomoki Shirasawa
8e4cbfeea1 print exit code or signal, if stderr is a tty 2013-12-10 14:45:37 +09:00
Tomoki Shirasawa
daec3b2f32 propagate exit code and signal 2013-12-10 14:40:22 +09:00
Tomoki Shirasawa
e5890aa949 typo fix 2013-11-14 16:27:11 +09:00
Tomoki Shirasawa
3f60324d4e add copyright 2013-11-14 15:55:00 +09:00
Naoki Hamada
3c490dcfab Added <sys/resource.h> which is required by getrlimit(2).
modified:   executer/user/mcexec.c
2013-11-07 00:29:17 -08:00
NAKAMURA Gou
a80d11cde5 prevents MCKERNEL_RLIMIT_STACK from overwriting
When mcexec reduces a stack, mcexec stores the original RLIMIT_STACK
in environment variable MCKERNEL_RLIMIT_STACK.
A fix to prohibit overwrite of this time.

Therefore, the value of RLIMIT_STACK of the McKernel's process is
decided in the following order.
(1) If environment variable MCKERNEL_RLIMIT_STACK exists; the value.
(2) A value of RLIMIT_STACK in the mcexec starting.
2013-10-30 14:28:32 +09:00
NAKAMURA Gou
011ef60c4b support decimal numbers at MCKERNEL_RLIMIT_STACK 2013-10-30 14:28:32 +09:00
NAKAMURA Gou
d557ba84d6 exclude interpreter's segment from data region
When an interpreter is located on the lower address (e.g. 0x0),
the text region is included in data region.
A fix to avoid this.
2013-10-30 14:28:32 +09:00
NAKAMURA Gou
603ef85454 mcexec: add a upper limit of the stack size
- When the stack size is greater than 1 GiB, reduced to 10 MiB.
- To achieve a reduction of the stack, restart itself using the exec().
- By using the environment variable MCKERNEL_RLIMIT_STACK,
  tell to McKernel the stack size of the original.
2013-10-11 22:36:16 +09:00
NAKAMURA Gou
3d32350be0 mcexec: add use of MCKERNEL_RLIMIT_STACK
MCKERNEL_RLIMIT_STACK is a environment variable which
specify RLIMIT_STACK value on McKernel.

syntax: MCKERNEL_RLIMIT_STACK=<cur>,<max>

example: MCKERNEL_RLIMIT_STACK=0x800000,-1
cur=8MiB, max=unlimited
2013-10-11 22:36:16 +09:00
NAKAMURA Gou
4fb6620f3a sys_getrlimit: modified to return mcexec's RLIMIT_STACK 2013-10-11 22:36:16 +09:00
NAKAMURA Gou
bc173baf13 mcexec: add a path prefix for interpreter search
- When the interpreter is not found,
  add a prefix to the path and retry search.
- the prefix is specified by a environment variable MCEXEC_ALT_ROOT.
- If the MCEXEC_ALT_ROOT does not exist,
  /usr/linux-k1om-4.7/linux-k1om is used as a prefix.
2013-10-11 22:23:22 +09:00
NAKAMURA Gou
413fe7b54a mcexec: add a interpreter invocation
When start a program which have a PT_INTERP segment
(dynamic linkaged program have a PT_INTERP segment),
start the interpreter indicated by the PT_INTERP segment.
2013-10-11 22:23:22 +09:00
NAKAMURA Gou
a171da1015 add a AT_ENTRY entry to the auxiliary vector 2013-10-11 22:23:22 +09:00
Tomoki Shirasawa
040fb64b22 add terminate thread 2013-09-02 00:39:22 +09:00
Tomoki Shirasawa
1d69225532 mcexec forward signal to MIC process. 2013-08-19 12:17:23 +09:00
NAKAMURA Gou
591f398768 add page fault forwarding 2013-08-08 12:43:15 +09:00
NAKAMURA Gou
78d9d3fcd2 Revert "trial implementation of private file mapping"
This reverts commit abe57218c4.
2013-07-26 16:44:39 +09:00
NAKAMURA Gou
abe57218c4 trial implementation of private file mapping
for review only.  will soon be reverted.
2013-07-26 14:40:12 +09:00
Tomoki Shirasawa
70e46dcd4b mcexec print signum or exit status 2013-07-26 13:14:39 +09:00
NAKAMURA Gou
b6d25861e5 create more mcexec thread so that all cpu to be serviced. 2013-07-18 09:25:58 +09:00
NAKAMURA Gou
2aa5194958 rewrite sys_mmap() as sys_new_mmap() 2013-07-10 13:11:19 +09:00
NAKAMURA Gou
5369864551 fix warnings 2013-06-19 16:47:02 +09:00
NAKAMURA Gou
32b8cc4651 delete unused codes 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
8a7429d872 delete SYSCALL_DECLARE(gettimeofday) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
329dd42c32 add gettimeofday by physical buffer. used by futex() 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
3d11115491 delete SYSCALL_DECLARE(readlink) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
1167ea7fb6 delete SYSCALL_DECLARE(getdents64) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
b463f39344 delete SYSCALL_DECLARE(access) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
628793225f delete SYSCALL_DECLARE(getcwd) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
d6f6e4d6d7 delete SYSCALL_DECLARE(uname) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
4494e54d38 delete SYSCALL_DECLARE(lseek) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
58c5a45aad delete SYSCALL_DECLARE(close) 2013-06-17 18:07:26 +09:00
NAKAMURA Gou
43792fbce9 delete SYSCALL_DECLARE(pwrite) 2013-06-17 18:07:25 +09:00