static void
keyctl_instantiate_key_iov(struct tcb *tcp, key_serial_t id1,
                           long addr, long len, key_serial_t id2)
{
    print_keyring_serial_number(id1);
    tprints(", ");
    tprint_iov(tcp, len, addr, 1);
    tprintf(", %lu, ", len);
    print_keyring_serial_number(id2);
}
Beispiel #2
0
int
sys_writev(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu", tcp->u_arg[2]);
	}
	return 0;
}
Beispiel #3
0
int
sys_pwritev(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu, ", tcp->u_arg[2]);
		print_llu_from_low_high_val(tcp, 3);
	}
	return 0;
}
int
sys_pwritev(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu, ", tcp->u_arg[2]);
		printllval(tcp, "%llu", PREAD_OFFSET_ARG);
	}
	return 0;
}
Beispiel #5
0
int
sys_writev(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		unsigned long total_size = dump_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
		tprintf(", %lu", tcp->u_arg[2]);
		tprintf(", %lu", total_size);
	}
	return 0;
}
Beispiel #6
0
static int
keyctl_instantiate_key_iov(struct tcb *tcp, key_serial_t id1,
                           long addr, long len, key_serial_t id2)
{
    if (entering(tcp)) {
        tprints(", ");
        print_keyring_serial_number(id1);
        tprints(", ");
        tprint_iov(tcp, len, addr, 1);
        tprintf(", %lu, ", len);
        print_keyring_serial_number(id2);
    }
    return 0;
}
Beispiel #7
0
int
sys_vmsplice(struct tcb *tcp)
{
	if (entering(tcp)) {
		/* int fd */
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
		/* const struct iovec *iov, unsigned long nr_segs */
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu, ", tcp->u_arg[2]);
		/* unsigned int flags */
		printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
	}
	return 0;
}
Beispiel #8
0
int
sys_preadv(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
	} else {
		if (syserror(tcp)) {
			tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
			return 0;
		}
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu, ", tcp->u_arg[2]);
		printllval(tcp, "%llu", PREAD_OFFSET_ARG);
	}
	return 0;
}
Beispiel #9
0
int
sys_readv(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
	} else {
		if (syserror(tcp)) {
			tprintf("%#lx, %lu",
					tcp->u_arg[1], tcp->u_arg[2]);
			return 0;
		}
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu", tcp->u_arg[2]);
	}
	return 0;
}
Beispiel #10
0
int
sys_preadv(struct tcb *tcp)
{
	if (entering(tcp)) {
		printfd(tcp, tcp->u_arg[0]);
		tprints(", ");
	} else {
		if (syserror(tcp)) {
			tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
			return 0;
		}
		tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
		tprintf(", %lu, ", tcp->u_arg[2]);
		print_llu_from_low_high_val(tcp, 3);
	}
	return 0;
}
Beispiel #11
0
static int
do_pwritev(struct tcb *tcp, const int flags_arg)
{
	kernel_ulong_t len =
		truncate_kulong_to_current_wordsize(tcp->u_arg[2]);

	printfd(tcp, tcp->u_arg[0]);
	tprints(", ");
	tprint_iov(tcp, len, tcp->u_arg[1], IOV_DECODE_STR);
	tprintf(", %" PRI_klu ", ", len);
	print_lld_from_low_high_val(tcp, 3);
	if (flags_arg >= 0) {
		tprints(", ");
		printflags(rwf_flags, tcp->u_arg[flags_arg], "RWF_???");
	}

	return RVAL_DECODED;
}
Beispiel #12
0
Datei: net.c Projekt: quanpt/CDE
static void
do_msghdr(struct tcb *tcp, struct msghdr *msg)
{
	tprintf("{msg_name(%d)=", msg->msg_namelen);
	printsock(tcp, (long)msg->msg_name, msg->msg_namelen);

	tprintf(", msg_iov(%lu)=", (unsigned long)msg->msg_iovlen);
	tprint_iov(tcp, (unsigned long)msg->msg_iovlen,
		   (unsigned long)msg->msg_iov);

#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
	tprintf(", msg_controllen=%lu", (unsigned long)msg->msg_controllen);
	if (msg->msg_controllen)
		printcmsghdr(tcp, (unsigned long) msg->msg_control,
			     msg->msg_controllen);
	tprintf(", msg_flags=");
	printflags(msg_flags, msg->msg_flags, "MSG_???");
#else /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
	tprintf("msg_accrights=%#lx, msg_accrightslen=%u",
		(unsigned long) msg->msg_accrights, msg->msg_accrightslen);
#endif /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
	tprintf("}");
}
Beispiel #13
0
static void
print_iocb(struct tcb *tcp, const struct iocb *cb)
{
	enum iocb_sub sub = print_iocb_header(tcp, cb);

	switch (sub) {
	case SUB_COMMON:
		if (cb->aio_lio_opcode == 1 && iocb_is_valid(cb)) {
			tprints(", str=");
			printstr(tcp, (unsigned long) cb->aio_buf,
				 (unsigned long) cb->aio_nbytes);
		} else {
			tprintf(", buf=%#" PRIx64, (uint64_t) cb->aio_buf);
		}
		tprintf(", nbytes=%" PRIu64 ", offset=%" PRId64,
			(uint64_t) cb->aio_nbytes, (int64_t) cb->aio_offset);
		print_common_flags(tcp, cb);
		break;
	case SUB_VECTOR:
		if (iocb_is_valid(cb)) {
			tprints(", iovec=");
			tprint_iov(tcp, cb->aio_nbytes, cb->aio_buf,
				   cb->aio_lio_opcode == 8
				   ? IOV_DECODE_STR
				   : IOV_DECODE_ADDR);
		} else {
			tprintf(", buf=%#" PRIx64 ", nbytes=%" PRIu64,
				(uint64_t) cb->aio_buf,
				(uint64_t) cb->aio_nbytes);
		}
		tprintf(", offset=%" PRId64, (int64_t) cb->aio_offset);
		print_common_flags(tcp, cb);
		break;
	case SUB_NONE:
		break;
	}
}
Beispiel #14
0
int
sys_ptrace(struct tcb *tcp)
{
	const struct xlat *x;
	unsigned long addr;

	if (entering(tcp)) {
		printxval(ptrace_cmds, tcp->u_arg[0], "PTRACE_???");
		tprintf(", %lu, ", tcp->u_arg[1]);

		addr = tcp->u_arg[2];
		if (tcp->u_arg[0] == PTRACE_PEEKUSER
		 || tcp->u_arg[0] == PTRACE_POKEUSER
		) {
			for (x = struct_user_offsets; x->str; x++) {
				if (x->val >= addr)
					break;
			}
			if (!x->str)
				tprintf("%#lx, ", addr);
			else if (x->val > addr && x != struct_user_offsets) {
				x--;
				tprintf("%s + %ld, ", x->str, addr - x->val);
			}
			else
				tprintf("%s, ", x->str);
		} else
		if (tcp->u_arg[0] == PTRACE_GETREGSET
		 || tcp->u_arg[0] == PTRACE_SETREGSET
		) {
			printxval(nt_descriptor_types, tcp->u_arg[2], "NT_???");
			tprints(", ");
		} else
			tprintf("%#lx, ", addr);


		switch (tcp->u_arg[0]) {
#ifndef IA64
		case PTRACE_PEEKDATA:
		case PTRACE_PEEKTEXT:
		case PTRACE_PEEKUSER:
			break;
#endif
		case PTRACE_CONT:
		case PTRACE_SINGLESTEP:
		case PTRACE_SYSCALL:
		case PTRACE_DETACH:
			printsignal(tcp->u_arg[3]);
			break;
		case PTRACE_SETOPTIONS:
			printflags(ptrace_setoptions_flags, tcp->u_arg[3], "PTRACE_O_???");
			break;
		case PTRACE_SETSIGINFO: {
			printsiginfo_at(tcp, tcp->u_arg[3]);
			break;
		}
		case PTRACE_SETREGSET:
			tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
			break;
		case PTRACE_GETSIGINFO:
		case PTRACE_GETREGSET:
			/* Don't print anything, do it at syscall return. */
			break;
		default:
			tprintf("%#lx", tcp->u_arg[3]);
			break;
		}
	} else {
		switch (tcp->u_arg[0]) {
		case PTRACE_PEEKDATA:
		case PTRACE_PEEKTEXT:
		case PTRACE_PEEKUSER:
#ifdef IA64
			return RVAL_HEX;
#else
			printnum_long(tcp, tcp->u_arg[3], "%#lx");
			break;
#endif
		case PTRACE_GETSIGINFO: {
			printsiginfo_at(tcp, tcp->u_arg[3]);
			break;
		}
		case PTRACE_GETREGSET:
			tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
			break;
		}
	}
	return 0;
}
Beispiel #15
0
int
sys_io_submit(struct tcb *tcp)
{
	long nr;
	if (entering(tcp)) {
		tprintf("%lu, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
		nr = tcp->u_arg[1];
		/* and if nr is negative? */
		if (nr == 0)
			tprints("{}");
		else {
#ifdef HAVE_LIBAIO_H
			long i;
			struct iocb *iocbp, **iocbs = (void *)tcp->u_arg[2];

			for (i = 0; i < nr; i++, iocbs++) {
				enum iocb_sub sub;
				struct iocb iocb;
				if (i == 0)
					tprints("{");
				else
					tprints(", ");

				if (umove(tcp, (unsigned long)iocbs, &iocbp) ||
				    umove(tcp, (unsigned long)iocbp, &iocb)) {
					tprints("{...}");
					continue;
				}
				tprints("{");
				if (iocb.data)
					tprintf("data:%p, ", iocb.data);
				if (iocb.key)
					tprintf("key:%u, ", iocb.key);
				tprintf("%s, ", iocb_cmd_lookup(iocb.aio_lio_opcode, &sub));
				if (iocb.aio_reqprio)
					tprintf("reqprio:%d, ", iocb.aio_reqprio);
				tprintf("filedes:%d", iocb.aio_fildes);
				switch (sub) {
				case SUB_COMMON:
#if HAVE_DECL_IO_CMD_PWRITE
					if (iocb.aio_lio_opcode == IO_CMD_PWRITE) {
						tprints(", str:");
						printstr(tcp, (unsigned long)iocb.u.c.buf,
							 iocb.u.c.nbytes);
					} else
#endif
						tprintf(", buf:%p", iocb.u.c.buf);
					tprintf(", nbytes:%lu, offset:%lld",
						iocb.u.c.nbytes,
						iocb.u.c.offset);
					print_common_flags(&iocb);
					break;
				case SUB_VECTOR:
					tprintf(", %lld", iocb.u.v.offset);
					print_common_flags(&iocb);
					tprints(", ");
					tprint_iov(tcp, iocb.u.v.nr,
						   (unsigned long)iocb.u.v.vec,
#if HAVE_DECL_IO_CMD_PWRITEV
						   iocb.aio_lio_opcode == IO_CMD_PWRITEV
#else
						   0
#endif
						  );
					break;
				case SUB_POLL:
					tprintf(", %x", iocb.u.poll.events);
					break;
				case SUB_NONE:
				        break;
				}
				tprints("}");
			}
			if (i)
				tprints("}");
#else
#warning "libaio.h is not available => no io_submit decoding"
			tprintf("%#lx", tcp->u_arg[2]);
#endif
		}
	}
	return 0;
}