GSoC status report - #3 of 10

Dmitry V. Levin ldv at altlinux.org
Wed Jun 30 18:03:17 UTC 2021


Hi,

On Tue, Jun 29, 2021 at 02:57:02AM -0400, Srikavin Ramkumar wrote:
[...]
>     // Debug Location: defs/example.syzlang:1:1 Node Type: AST_SYSCALL
>     SYS_FUNC(read)
>     {
>         if (entering(tcp)) {
>             /* arg: fd (fd) */
>             printfd(tcp, (tcp)->u_arg[0]);
>             tprint_arg_next();
>     
>             return 0;
>         }
>         /* arg: buf (stringnoz *) */
>         if (syserror(tcp)) {
>             printaddr((tcp)->u_arg[1]);
>         } else {
>             printstrn(tcp, (tcp)->u_arg[1], (tcp)->u_rval);
>         }
>         tprint_arg_next();
>     
>         /* arg: count (size_t) */
>         PRINT_VAL_U((size_t) (tcp)->u_arg[2]);
>     
>         return RVAL_DECODED;
>     }

Note that this size_t is actually the kernel's size_t, not the size_t
of userspace.  They are the same on most of architectures, but there are
exceptions, for example, x32 is one of ilp32 architectures that can use
64-bit syscalls.  In those cases the kernel's size_t should be used
instead.  This could be done e.g. by introducing a kernel_size_t type
(as a typedef to kernel_ulong_t).


-- 
ldv


More information about the Strace-devel mailing list