- 18 Jan, 2013 9 commits
-
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
These functions are designated to convert a native pointer to uint64_t used to store a virtual address in protobuf messages and vice versa in a machine-independent way. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
The patch reverts the commit 58064d9b. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
If a task executes a non-userspace code (that sometimes takes place on ARM) while being seized the subsequent infection with the syscall blob fails because ptrace fails to write to the VMA the PC is in. The patch modifies the function get_vma_by_ip() to check the PC of the task being seized is below the TASK_SIZE boundary. If the check fails the first suitable VMA is infected. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This patch prevents compilation warnings about shift overflow on ARM. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
The macro specifies the size of the machine pointer explicitly. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This patch fixes format strings in newly added code. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 17 Jan, 2013 15 commits
-
-
Cyrill Gorcunov authored
Reported-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kinsbursky Stanislav authored
This part was lost after update to "sysctl" interface for IPC object ID specifying (previous, currently obsolete, interface was able to pass proper credentials with KEY change) . Signed-off-by:
Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Kinsbursky Stanislav authored
Signed-off: Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Oracle has such mappings. v2: add check, that a file is a character device Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We check shared lock, exclusive lock and mandatory-read lock for flock file locks. After restore, by parsing /proc/locks file, we check if the process holds the same file locks as it was dumped. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We check read lock and write lock for posix file locks. After restore, we use fcntl(fd, F_GETLK, &lock), to see if the file is hold the same lock as it was dumped. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
According to the file lock information from the image, we recall flock or fcntl with proper parameters, so we can rehold the file locks as we were dumped. We only support flock and posix file locks so far. Changelog since the initial version: a. Use prepare_file_locks instead of restore function directly. b. Fix some bugs. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Dump file locks' necessary entries to the image, we only support flock and posix file lock right now. Changelog since the initial version: We got file lock info from global list, so the dump_task_file_locks can be much simpler. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We collect all file locks to a golbal list, so we can use them easily in dump_one_task. For optimizaton, we only collect file locks hold by tasks in the pstree. Thanks to the ptrace-seize machanism, we can aviod the blocked file lock issue, makes the work simpler. Right now, the check handles only one situation: -- Dumping tasks with file locks hold without the -l option. This covers for the most part. But we still need some more work to make it perfect robust in the future. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Sometimes, when we parse some global info files, we can only care about tasks which are taken into dump(such as file locks), which means their pids are in the pstree. So a function like this would be help. Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Some contents needed by filelock's image. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Add a callback for filelock's image show. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
We need a new protobuf description for file-lock. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Qiang Huang authored
Add --file-locks/-l option to support handling file locks, for safety, only used for container. Originally-signed-off-by:
Zheng Gu <cengku.gu@huawei.com> Signed-off-by:
Qiang Huang <h.huangqiang@huawei.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 16 Jan, 2013 12 commits
-
-
Alexander Kartashov authored
This workarounds a compilation warning on ARM: packet-sock.pb-c.c: In function 'packet_sock_entry__init': packet-sock.pb-c.c:98:3: error: this decimal constant is unsigned only in ISO C90 [-Werror] packet-sock.pb-c.c: At top level: packet-sock.pb-c.c:318:1: error: this decimal constant is unsigned only in ISO C90 [-Werror] Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This patch replaces the format specifier %ld with PRIx64 in the following places: * the format string argument of the functions scanf() and printf(), * in the macros GEN_SYSCTL_*_FUNC. We need explicit specification of the integer size there. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
The layout of the struct rlimit depends on the value of the macro FILE_OFFSET_BITS. If FILE_OFFSET_BITS is 64 the userspace and kernel definitions becomes incoherent on a 32-bit platform. The struct krlimit representing the kernel version of the struct rlimit is introduced to address the issue: the function restore_rlims() is fixed to convert between the userspace and kernel representations of the struct. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
This makes it possible to use TASK_SIZE instead of TASK_SIZE_MAX. Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Alexander Kartashov authored
Signed-off-by:
Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
I occasionally read FanotifyMarkEntry object as InotifyWdEntry in collect_one_fanotify_mark, this didn't trigger a bug in test since the events are still occured (and before protobuf file refine the formats were close to each other), which means the fanotify00 test-case need to be updated (which is addressed in further patch). And don't forget to init fields. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
The object is allocated with malloc. The lack of initialization is not problem at moment since we assign members in collect_inotify_mark unconditionally but it might cause problems in future so better to init it as early as possible. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Just reading if event entry exist in buffer is not enough we rathee need to be sure that all flags and bits are recovered well. For this sake we parse fdinfo before and after the c/r sessions and compare results. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Just missed it in first place. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To be consistent with naming (we have collect_one_fanotify_mark helper already). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This removes code duplication. There is no strong need for free_fhandle but I decided to add it to be consistent with alloc/free handlers. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 15 Jan, 2013 4 commits
-
-
Pavel Emelyanov authored
These are structs that (now) tie together ns string and the CLONE_ flag. It's nice to have one (some code becomes simpler) and will help us with auto-namespaces detection. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
As Pavel proposed we can refine fanotify image objects squeezing common part in separate entry. Finally the objects are grouped as enum mark_type { INODE = 1; MOUNT = 2; } message fanotify_inode_mark_entry { required uint64 i_ino = 1; required fh_entry f_handle = 2; } message fanotify_mount_mark_entry { required uint32 mnt_id = 1; } message fanotify_mark_entry { required uint32 id = 1; required mark_type type = 2; required uint32 mflags = 3; required uint32 mask = 4; required uint32 ignored_mask = 5; required uint32 s_dev = 6; optional fanotify_inode_mark_entry ie = 7; optional fanotify_mount_mark_entry me = 8; } This required some tuning in fdinfo parsing and fsnotify code itself, but result looks good to me. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
As Andrew pointed the logically it's more correct to use err() instead of fail() if test_daemon() has not been used. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> CC: Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-