It's not a fd to open and map, but SYSV IPC id instead.
So don't close it - this may lead to unpredictable results
(in case of SYSV IPC id will match fd, opened by processes).
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This looks clearer, because this check has nothing with SYSV IPC
mappings. Also we don't modify the vma_entry itself anymore but
operate with local 'flags' copy.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
[gorcunov@: A few tune ups]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
* Remove redundant messages
* Show which test will be executed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Otherwise 'make test' fails on a clean tree because crtools is not built.
Side effect: if you have code modifications that are not yet compiled,
they will be compiled.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
- make control block to keep all information
needed to run injected syscall and parasite
blobs
- add ptrace_swap_area helper
- handle both parasite engine calls and injected
syscalls by single __parasite_execute function
- drop jerr() usage
- bring back handling of inflight signals from
original program inside parasite code
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Added cloning to new IPC ns depends on built option.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Andrey Vagin <avagin@gmail.com>
This patch introduces the following changes:
1) writing of shmid value into vma_area->fd instead of
waiting for shared memory region is open by parent,
reopen it and dump fd.
2) new syscall support: sys_shmat
3) use sys_shmat() to map memory region in restorer's
mapping function if vma flag VMA_AREA_SYSVIPC is set.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Returning shmid value of not enough, because SYSV IPC shmid equal to zero is a
valid value.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This patch introduces the following changes:
1) introduces new flag VMA_AREA_SYSVIPC to mark corresponding vma entries.
2) enhance task /proc/<pid>/maps parsing to obtain first 5 letters of mapped
file. If device major file belong to ins equal to 0 (tmpfs) and it's name
starts with "/SYSV", then this mapping is considered as SYSV IPC and
corresponding vma entry status is updated with VMA_AREA_SYSVIPC flag.
3) omit dumping of mapping pages for SYSV IPC vmas.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
* 'zdtm' of https://github.com/avagin/crtools:
zdtm: remove white spaces
zdtm: transmit to crtools dump
zdtm: don't kill test processes in case an error
These defines are already provided by unistd.h, and the only user
is log.c which already includes unistd.h.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
* avagin/zdtm:
zdtm: transmit to crtools dump
zdtm: don't kill test processes in case an error
zdtm: add static/shm test to IPC ns tests list
zdtm: don't wait in IPC queue on message operations
- mmap_seized returns only NULL on error, drop
redumdant test
- setup control block in one group
- no need for err_free label, xfree handles NULL easily
- prepare registers for munmap_seized call on error path
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
- err_restore_full label is redundant
- must try to restore poked area if it's
parially corrupted
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
It actually not a problem since we never reach a tail
out of blob, but better to be on a safe side (after
all there is no guarantee that .data section will not
end up exactly at blob final bytes).
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
They are not needed at moment but will be needed at
parasite/restorer code rework time, so add them now
just to not forget.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
It's pretty convenient to have asm generated code
at hands if hunting weird problems.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>