Commit a00ef142 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

Use pr_err for error printing

To follow kernel style
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent f83520aa
...@@ -91,7 +91,7 @@ err: ...@@ -91,7 +91,7 @@ err:
return ret; return ret;
err_bogus_mapping: err_bogus_mapping:
pr_error("Bogus mapping %lx-%lx\n", pr_err("Bogus mapping %lx-%lx\n",
vma_area->vma.start, vma_area->vma.start,
vma_area->vma.end); vma_area->vma.end);
goto err; goto err;
...@@ -156,7 +156,7 @@ static int dump_pipe_and_data(int lfd, struct pipe_entry *e, ...@@ -156,7 +156,7 @@ static int dump_pipe_and_data(int lfd, struct pipe_entry *e,
pipe_size = fcntl(lfd, F_GETPIPE_SZ); pipe_size = fcntl(lfd, F_GETPIPE_SZ);
if (pipe_size < 0) { if (pipe_size < 0) {
pr_error("Can't obtain piped data size\n"); pr_err("Can't obtain piped data size\n");
goto err; goto err;
} }
...@@ -215,7 +215,7 @@ err: ...@@ -215,7 +215,7 @@ err:
pr_info("Dumped pipe: fd: %8lx pipeid: %8lx flags: %8lx bytes: %8lx\n", pr_info("Dumped pipe: fd: %8lx pipeid: %8lx flags: %8lx bytes: %8lx\n",
e.fd, e.pipeid, e.flags, e.bytes); e.fd, e.pipeid, e.flags, e.bytes);
else else
pr_error("Dumping pipe %d/%x flags %x\n", fd, id, flags); pr_err("Dumping pipe %d/%x flags %x\n", fd, id, flags);
return ret; return ret;
} }
...@@ -273,7 +273,7 @@ static int dump_one_fd(char *pid_fd_dir, int dir, char *fd_name, unsigned long p ...@@ -273,7 +273,7 @@ static int dump_one_fd(char *pid_fd_dir, int dir, char *fd_name, unsigned long p
return 0; return 0;
} }
pr_error("Can't dump file %s of that type [%x]\n", fd_name, st_buf.st_mode); pr_err("Can't dump file %s of that type [%x]\n", fd_name, st_buf.st_mode);
return 1; return 1;
} }
...@@ -436,7 +436,7 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size) ...@@ -436,7 +436,7 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size)
int ret = -1; int ret = -1;
if (size != GDT_ENTRY_TLS_ENTRIES) { if (size != GDT_ENTRY_TLS_ENTRIES) {
pr_error("Wrong TLS storage size: %d\n", size); pr_err("Wrong TLS storage size: %d\n", size);
goto err; goto err;
} }
...@@ -451,12 +451,12 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size) ...@@ -451,12 +451,12 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size)
while (fgets(loc_buf, sizeof(loc_buf), file)) { while (fgets(loc_buf, sizeof(loc_buf), file)) {
u32 a, b; u32 a, b;
if (sscanf(loc_buf, "%x %x", &a, &b) != 2) { if (sscanf(loc_buf, "%x %x", &a, &b) != 2) {
pr_error("Can't parse tls entry: %s\n"); pr_err("Can't parse tls entry: %s\n");
ret = -1; ret = -1;
goto err; goto err;
} }
if (ret >= GDT_ENTRY_TLS_ENTRIES) { if (ret >= GDT_ENTRY_TLS_ENTRIES) {
pr_error("Too many entries in tls\n"); pr_err("Too many entries in tls\n");
ret = -1; ret = -1;
goto err; goto err;
} }
...@@ -467,7 +467,7 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size) ...@@ -467,7 +467,7 @@ static int dump_task_tls(pid_t pid, struct desc_struct *tls_array, int size)
} }
if (ret != GDT_ENTRY_TLS_ENTRIES) { if (ret != GDT_ENTRY_TLS_ENTRIES) {
pr_error("tls returened %i entries instead of %i\n", pr_err("tls returened %i entries instead of %i\n",
ret, GDT_ENTRY_TLS_ENTRIES); ret, GDT_ENTRY_TLS_ENTRIES);
ret = -1; ret = -1;
goto err; goto err;
...@@ -606,7 +606,7 @@ static struct pstree_item *find_children(pid_t pid) ...@@ -606,7 +606,7 @@ static struct pstree_item *find_children(pid_t pid)
fclose(file), file = NULL; fclose(file), file = NULL;
if (!found) { if (!found) {
pr_error("Children marker is not found\n"); pr_err("Children marker is not found\n");
goto err; goto err;
} }
...@@ -842,63 +842,63 @@ static int dump_one_task(pid_t pid, struct cr_fdset *cr_fdset) ...@@ -842,63 +842,63 @@ static int dump_one_task(pid_t pid, struct cr_fdset *cr_fdset)
ret = collect_mappings(pid); ret = collect_mappings(pid);
if (ret) { if (ret) {
pr_error("Collect mappings (pid: %d) failed with %d\n", pid, ret); pr_err("Collect mappings (pid: %d) failed with %d\n", pid, ret);
goto err; goto err;
} }
ret = seize_task(pid); ret = seize_task(pid);
if (ret) { if (ret) {
pr_error("Failed to seize task (pid: %d) with %d\n", pr_err("Failed to seize task (pid: %d) with %d\n",
pid, ret); pid, ret);
goto err; goto err;
} }
ret = dump_task_core_seized(pid, cr_fdset); ret = dump_task_core_seized(pid, cr_fdset);
if (ret) { if (ret) {
pr_error("Dump core (pid: %d) failed with %d\n", pid, ret); pr_err("Dump core (pid: %d) failed with %d\n", pid, ret);
goto err; goto err;
} }
parasite_ctl = parasite_infect_seized(pid, NULL, &vma_area_list); parasite_ctl = parasite_infect_seized(pid, NULL, &vma_area_list);
if (!parasite_ctl) { if (!parasite_ctl) {
pr_error("Can't infect (pid: %d) with parasite\n", pid); pr_err("Can't infect (pid: %d) with parasite\n", pid);
goto err; goto err;
} }
ret = parasite_dump_pages_seized(parasite_ctl, &vma_area_list, ret = parasite_dump_pages_seized(parasite_ctl, &vma_area_list,
cr_fdset, CR_FD_PAGES); cr_fdset, CR_FD_PAGES);
if (ret) { if (ret) {
pr_error("Can't dump pages (pid: %d) with parasite\n", pid); pr_err("Can't dump pages (pid: %d) with parasite\n", pid);
goto err; goto err;
} }
ret = parasite_cure_seized(&parasite_ctl, &vma_area_list); ret = parasite_cure_seized(&parasite_ctl, &vma_area_list);
if (ret) { if (ret) {
pr_error("Can't cure (pid: %d) from parasite\n", pid); pr_err("Can't cure (pid: %d) from parasite\n", pid);
goto err; goto err;
} }
ret = unseize_task(pid); ret = unseize_task(pid);
if (ret) { if (ret) {
pr_error("Can't unsieze (pid: %d) task\n", pid); pr_err("Can't unsieze (pid: %d) task\n", pid);
goto err; goto err;
} }
ret = dump_task_files(pid, cr_fdset); ret = dump_task_files(pid, cr_fdset);
if (ret) { if (ret) {
pr_error("Dump files (pid: %d) failed with %d\n", pid, ret); pr_err("Dump files (pid: %d) failed with %d\n", pid, ret);
goto err; goto err;
} }
ret = dump_task_mappings(pid, cr_fdset); ret = dump_task_mappings(pid, cr_fdset);
if (ret) { if (ret) {
pr_error("Dump mappings (pid: %d) failed with %d\n", pid, ret); pr_err("Dump mappings (pid: %d) failed with %d\n", pid, ret);
goto err; goto err;
} }
ret = finalize_core(pid, cr_fdset); ret = finalize_core(pid, cr_fdset);
if (ret) { if (ret) {
pr_error("Finalizing core (pid: %d) failed with %d\n", pid, ret); pr_err("Finalizing core (pid: %d) failed with %d\n", pid, ret);
goto err; goto err;
} }
......
...@@ -184,7 +184,7 @@ static int collect_shmem(int pid, struct shmem_entry *e) ...@@ -184,7 +184,7 @@ static int collect_shmem(int pid, struct shmem_entry *e)
continue; continue;
if (shmems[i].end != e->end) { if (shmems[i].end != e->end) {
pr_error("Bogus shmem\n"); pr_err("Bogus shmem\n");
return 1; return 1;
} }
...@@ -270,7 +270,7 @@ static int collect_pipe(int pid, struct pipe_entry *e, int p_fd) ...@@ -270,7 +270,7 @@ static int collect_pipe(int pid, struct pipe_entry *e, int p_fd)
pipes[nr_pipes].status = PIPE_WRONLY; pipes[nr_pipes].status = PIPE_WRONLY;
break; break;
default: default:
pr_error("%d: Unknown pipe status pipeid %d\n", pr_err("%d: Unknown pipe status pipeid %d\n",
pid, e->pipeid); pid, e->pipeid);
break; break;
} }
...@@ -437,7 +437,7 @@ static int open_fe_fd(struct fdinfo_entry *fe, int fd) ...@@ -437,7 +437,7 @@ static int open_fe_fd(struct fdinfo_entry *fe, int fd)
int tmp; int tmp;
if (read(fd, path, fe->len) != fe->len) { if (read(fd, path, fe->len) != fe->len) {
pr_error("Error reading path"); pr_err("Error reading path");
return -1; return -1;
} }
...@@ -518,7 +518,7 @@ static int prepare_fds(int pid) ...@@ -518,7 +518,7 @@ static int prepare_fds(int pid)
read(fdinfo_fd, &mag, 4); read(fdinfo_fd, &mag, 4);
if (mag != FDINFO_MAGIC) { if (mag != FDINFO_MAGIC) {
pr_error("Bad file magic number in %s\n", path); pr_err("Bad file magic number in %s\n", path);
return 1; return 1;
} }
...@@ -538,7 +538,7 @@ static int prepare_fds(int pid) ...@@ -538,7 +538,7 @@ static int prepare_fds(int pid)
} }
if (ret != sizeof(fe)) { if (ret != sizeof(fe)) {
pr_error("Corrupted file %s\n", path); pr_err("Corrupted file %s\n", path);
return 1; return 1;
} }
...@@ -554,7 +554,7 @@ static int prepare_fds(int pid) ...@@ -554,7 +554,7 @@ static int prepare_fds(int pid)
return 1; return 1;
break; break;
default: default:
pr_error("Unknown type in %s\n", path); pr_err("Unknown type in %s\n", path);
return 1; return 1;
} }
} }
...@@ -657,7 +657,7 @@ static int try_fixup_shared_map(int pid, struct vma_entry *vi, int fd) ...@@ -657,7 +657,7 @@ static int try_fixup_shared_map(int pid, struct vma_entry *vi, int fd)
pr_info("%d: Search for %016lx shmem %p/%d\n", pid, vi->start, si, si ? si->pid : -1); pr_info("%d: Search for %016lx shmem %p/%d\n", pid, vi->start, si, si ? si->pid : -1);
if (!si) { if (!si) {
pr_error("Can't find my shmem %016lx\n", vi->start); pr_err("Can't find my shmem %016lx\n", vi->start);
return 1; return 1;
} }
...@@ -755,7 +755,7 @@ static int fixup_pages_data(int pid, int fd) ...@@ -755,7 +755,7 @@ static int fixup_pages_data(int pid, int fd)
read(shfd, &magic, sizeof(magic)); read(shfd, &magic, sizeof(magic));
if (magic != PAGES_MAGIC) { if (magic != PAGES_MAGIC) {
pr_error("Bad shmem file magic number %s\n", path); pr_err("Bad shmem file magic number %s\n", path);
return 1; return 1;
} }
...@@ -905,7 +905,7 @@ static int create_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int ...@@ -905,7 +905,7 @@ static int create_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int
tmp = splice(pipes_fd, NULL, pfd[1], NULL, e->bytes, 0); tmp = splice(pipes_fd, NULL, pfd[1], NULL, e->bytes, 0);
if (tmp != e->bytes) { if (tmp != e->bytes) {
pr_error("Wanted to restore %d bytes, but got %d\n", pr_err("Wanted to restore %d bytes, but got %d\n",
e->bytes, tmp); e->bytes, tmp);
if (tmp < 0) if (tmp < 0)
perror("Error splicing data"); perror("Error splicing data");
...@@ -1014,7 +1014,7 @@ static int open_pipe(int pid, struct pipe_entry *e, int *pipes_fd) ...@@ -1014,7 +1014,7 @@ static int open_pipe(int pid, struct pipe_entry *e, int *pipes_fd)
pi = find_pipe(e->pipeid); pi = find_pipe(e->pipeid);
if (!pi) { if (!pi) {
pr_error("BUG: can't find my pipe %x\n", e->pipeid); pr_err("BUG: can't find my pipe %x\n", e->pipeid);
return 1; return 1;
} }
...@@ -1132,7 +1132,7 @@ static int restore_task_with_children(int my_pid, char *pstree_path) ...@@ -1132,7 +1132,7 @@ static int restore_task_with_children(int my_pid, char *pstree_path)
while (1) { while (1) {
ret = read(fd, &e, sizeof(e)); ret = read(fd, &e, sizeof(e));
if (ret != sizeof(e)) { if (ret != sizeof(e)) {
pr_error("%d: Read returned %d\n", my_pid, ret); pr_err("%d: Read returned %d\n", my_pid, ret);
if (ret < 0) if (ret < 0)
perror("Can't read pstree"); perror("Can't read pstree");
exit(1); exit(1);
......
...@@ -318,13 +318,13 @@ static int collect_pstree(pid_t pid, struct cr_fdset *cr_fdset) ...@@ -318,13 +318,13 @@ static int collect_pstree(pid_t pid, struct cr_fdset *cr_fdset)
item->children = xmalloc(size); item->children = xmalloc(size);
if (!item->children) { if (!item->children) {
pr_error("No memory for children pids\n"); pr_err("No memory for children pids\n");
goto err; goto err;
} }
ret = read(fd, item->children, size); ret = read(fd, item->children, size);
if (ret != size) { if (ret != size) {
pr_error("An error in reading children pids\n"); pr_err("An error in reading children pids\n");
xfree(item->children); xfree(item->children);
goto err; goto err;
} }
......
...@@ -162,7 +162,7 @@ int prep_cr_fdset_for_restore(struct cr_fdset *cr_fdset, ...@@ -162,7 +162,7 @@ int prep_cr_fdset_for_restore(struct cr_fdset *cr_fdset,
read_ptr_safe(cr_fdset->desc[i].fd, &magic, err); read_ptr_safe(cr_fdset->desc[i].fd, &magic, err);
if (magic != cr_fdset->desc[i].tmpl->magic) { if (magic != cr_fdset->desc[i].tmpl->magic) {
pr_error("Magic doesn't match for %s\n", pr_err("Magic doesn't match for %s\n",
cr_fdset->desc[i].name); cr_fdset->desc[i].name);
goto err; goto err;
} }
......
...@@ -107,11 +107,11 @@ int convert_to_elf(char *elf_path, int fd_core) ...@@ -107,11 +107,11 @@ int convert_to_elf(char *elf_path, int fd_core)
/* Figure out if we're overflowed */ /* Figure out if we're overflowed */
if (e_phnum > ELF_MAX_PHDR) { if (e_phnum > ELF_MAX_PHDR) {
pr_error("Too many VMA areas (%li of %li allowed)\n", pr_err("Too many VMA areas (%li of %li allowed)\n",
e_phnum, ELF_MAX_PHDR); e_phnum, ELF_MAX_PHDR);
goto err_close; goto err_close;
} else if (nrpages > ELF_MAX_PAGES) { } else if (nrpages > ELF_MAX_PAGES) {
pr_error("Too many pages to restore (%li of %li allowed)\n", pr_err("Too many pages to restore (%li of %li allowed)\n",
nrpages, ELF_MAX_PAGES); nrpages, ELF_MAX_PAGES);
goto err_close; goto err_close;
} }
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
extern void printk(const char *format, ...); extern void printk(const char *format, ...);
#define pr_info(fmt, ...) printk(fmt, ##__VA_ARGS__) #define pr_info(fmt, ...) printk(fmt, ##__VA_ARGS__)
#define pr_error(fmt, ...) printk("Error (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__) #define pr_err(fmt, ...) printk("Error (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#define pr_panic(fmt, ...) printk("PANIC (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__) #define pr_panic(fmt, ...) printk("PANIC (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#define pr_warning(fmt, ...) printk("Warning: " fmt, ##__VA_ARGS__) #define pr_warning(fmt, ...) printk("Warning: " fmt, ##__VA_ARGS__)
#define pr_error_jmp(label) \ #define pr_err_jmp(label) \
do { \ do { \
printk("EJMP: %s:%d\n", __FILE__, __LINE__); \ printk("EJMP: %s:%d\n", __FILE__, __LINE__); \
goto label; \ goto label; \
...@@ -29,20 +29,20 @@ extern void printk(const char *format, ...); ...@@ -29,20 +29,20 @@ extern void printk(const char *format, ...);
#define jerr(code, label) \ #define jerr(code, label) \
do { \ do { \
if ((code)) \ if ((code)) \
pr_error_jmp(label); \ pr_err_jmp(label); \
} while (0) } while (0)
#define jerr_cond(code, cond, label) \ #define jerr_cond(code, cond, label) \
do { \ do { \
if ((code) cond) \ if ((code) cond) \
pr_error_jmp(label); \ pr_err_jmp(label); \
} while (0) } while (0)
#define jerr_rc(code, rc, label) \ #define jerr_rc(code, rc, label) \
do { \ do { \
rc = (code); \ rc = (code); \
if (rc) \ if (rc) \
pr_error_jmp(label); \ pr_err_jmp(label); \
} while (0) } while (0)
#if 0 #if 0
...@@ -65,7 +65,7 @@ extern void printk(const char *format, ...); ...@@ -65,7 +65,7 @@ extern void printk(const char *format, ...);
#define pr_perror(fmt, ...) \ #define pr_perror(fmt, ...) \
do { \ do { \
pr_error("%s: " fmt, strerror(errno), \ pr_err("%s: " fmt, strerror(errno), \
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while (0) } while (0)
...@@ -154,7 +154,7 @@ int close_safe(int *fd); ...@@ -154,7 +154,7 @@ int close_safe(int *fd);
({ \ ({ \
void *___p = op( __VA_ARGS__ ); \ void *___p = op( __VA_ARGS__ ); \
if (!___p) \ if (!___p) \
pr_error("%s: Can't allocate %li bytes\n", \ pr_err("%s: Can't allocate %li bytes\n", \
__func__, (long)(size)); \ __func__, (long)(size)); \
___p; \ ___p; \
}) })
......
...@@ -284,7 +284,7 @@ again: ...@@ -284,7 +284,7 @@ again:
if (ptrace_poke_area((long)ctl->pid, (void *)parasite_arg.args, if (ptrace_poke_area((long)ctl->pid, (void *)parasite_arg.args,
(void *)ctl->addr_args, parasite_arg.args_size)) { (void *)ctl->addr_args, parasite_arg.args_size)) {
pr_error("Can't setup parasite arguments (pid: %d)\n", ctl->pid); pr_err("Can't setup parasite arguments (pid: %d)\n", ctl->pid);
goto err_restore; goto err_restore;
} }
...@@ -324,7 +324,7 @@ retry_signal: ...@@ -324,7 +324,7 @@ retry_signal:
(void *)(ctl->addr_args + (void *)(ctl->addr_args +
offsetof(parasite_args_cmd_dumppages_t, fd)), offsetof(parasite_args_cmd_dumppages_t, fd)),
sizeof(parasite_dumppages.fd))) { sizeof(parasite_dumppages.fd))) {
pr_error("Can't get file descriptor back (pid: %d)\n", ctl->pid); pr_err("Can't get file descriptor back (pid: %d)\n", ctl->pid);
goto err_restore; goto err_restore;
} }
} }
...@@ -337,7 +337,7 @@ retry_signal: ...@@ -337,7 +337,7 @@ retry_signal:
(void *)(ctl->addr_args + (void *)(ctl->addr_args +
offsetof(parasite_args_cmd_dumppages_t, nrpages_dumped)), offsetof(parasite_args_cmd_dumppages_t, nrpages_dumped)),
sizeof(parasite_dumppages.fd))) { sizeof(parasite_dumppages.fd))) {
pr_error("Can't get statistics (pid: %d)\n", ctl->pid); pr_err("Can't get statistics (pid: %d)\n", ctl->pid);
goto err_restore; goto err_restore;
} }
pr_info(" (dumped: %16li pages)\n", parasite_dumppages.nrpages_dumped); pr_info(" (dumped: %16li pages)\n", parasite_dumppages.nrpages_dumped);
...@@ -409,7 +409,7 @@ int parasite_cure_seized(struct parasite_ctl **p_ctl, ...@@ -409,7 +409,7 @@ int parasite_cure_seized(struct parasite_ctl **p_ctl,
vma_area = get_vma_by_ip(vma_area_list, regs.ip); vma_area = get_vma_by_ip(vma_area_list, regs.ip);
if (!vma_area) { if (!vma_area) {
pr_error("No suitable VMA found to run cure (pid: %d)\n", ctl->pid); pr_err("No suitable VMA found to run cure (pid: %d)\n", ctl->pid);
goto err; goto err;
} }
...@@ -419,7 +419,7 @@ int parasite_cure_seized(struct parasite_ctl **p_ctl, ...@@ -419,7 +419,7 @@ int parasite_cure_seized(struct parasite_ctl **p_ctl,
(void *)ctl->vma_area->vma.start, (void *)ctl->vma_area->vma.start,
(size_t)vma_entry_len(&ctl->vma_area->vma)); (size_t)vma_entry_len(&ctl->vma_area->vma));
if (ret) if (ret)
pr_error("munmap_seized failed (pid: %d)\n", ctl->pid); pr_err("munmap_seized failed (pid: %d)\n", ctl->pid);
if (ptrace(PTRACE_SETREGS, ctl->pid, NULL, &regs_orig)) { if (ptrace(PTRACE_SETREGS, ctl->pid, NULL, &regs_orig)) {
ret = -1; ret = -1;
...@@ -440,7 +440,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l ...@@ -440,7 +440,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l
ctl = xzalloc(sizeof(*ctl) + sizeof(*vma_area)); ctl = xzalloc(sizeof(*ctl) + sizeof(*vma_area));
if (!ctl) { if (!ctl) {
pr_error("Parasite control block allocation failed (pid: %d)\n", pid); pr_err("Parasite control block allocation failed (pid: %d)\n", pid);
goto err; goto err;
} }
...@@ -449,11 +449,11 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l ...@@ -449,11 +449,11 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l
ctl->vma_area = (struct vma_area *)(char *)&ctl[sizeof(*ctl)]; ctl->vma_area = (struct vma_area *)(char *)&ctl[sizeof(*ctl)];
if (ptrace(PTRACE_GETREGS, pid, NULL, &regs)) if (ptrace(PTRACE_GETREGS, pid, NULL, &regs))
pr_error_jmp(err_free); pr_err_jmp(err_free);
vma_area = get_vma_by_ip(vma_area_list, regs.ip); vma_area = get_vma_by_ip(vma_area_list, regs.ip);
if (!vma_area) { if (!vma_area) {
pr_error("No suitable VMA found to run parasite " pr_err("No suitable VMA found to run parasite "
"bootstrap code (pid: %d)\n", pid); "bootstrap code (pid: %d)\n", pid);
goto err_free; goto err_free;
} }
...@@ -474,7 +474,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l ...@@ -474,7 +474,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l
(int)-1, (off_t)0); (int)-1, (off_t)0);
if (!mmaped || (long)mmaped < 0) { if (!mmaped || (long)mmaped < 0) {
pr_error("Can't allocate memory for parasite blob (pid: %d)\n", pid); pr_err("Can't allocate memory for parasite blob (pid: %d)\n", pid);
goto err_restore_regs; goto err_restore_regs;
} }
...@@ -487,7 +487,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l ...@@ -487,7 +487,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, void *addr_hint, struct l
ctl->vma_area->vma.end = (u64)(mmaped + parasite_size); ctl->vma_area->vma.end = (u64)(mmaped + parasite_size);
if (ptrace_poke_area(pid, parasite_blob, mmaped, parasite_size)) { if (ptrace_poke_area(pid, parasite_blob, mmaped, parasite_size)) {
pr_error("Can't inject parasite blob (pid: %d)\n", pid); pr_err("Can't inject parasite blob (pid: %d)\n", pid);
goto err_munmap_restore; goto err_munmap_restore;
} }
......
...@@ -297,7 +297,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list) ...@@ -297,7 +297,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list)
&start, &end, &r, &w, &x, &s, &pgoff, &dev_maj, &start, &end, &r, &w, &x, &s, &pgoff, &dev_maj,
&dev_min, &ino); &dev_min, &ino);
if (ret != 10) { if (ret != 10) {
pr_error("Can't parse: %s", big_buffer); pr_err("Can't parse: %s", big_buffer);
return -1; return -1;
} }
...@@ -375,7 +375,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list) ...@@ -375,7 +375,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list)
goto err; goto err;
} }
if (!S_ISREG(st_buf.st_mode)) { if (!S_ISREG(st_buf.st_mode)) {
pr_error("Can't handle non-regular " pr_err("Can't handle non-regular "
"mapping on %s%s\n", "mapping on %s%s\n",
map_files_path, map_files_path,
vma_file_path); vma_file_path);
...@@ -424,7 +424,7 @@ err: ...@@ -424,7 +424,7 @@ err:
return ret; return ret;
err_bogus_mapping: err_bogus_mapping:
pr_error("Bogus mapping %lx-%lx\n", pr_err("Bogus mapping %lx-%lx\n",
vma_area->vma.start, vma_area->vma.start,
vma_area->vma.end); vma_area->vma.end);
goto err; goto err;
......
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