]> granicus.if.org Git - strace/commitdiff
kexec: fix for the x32 ABI
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 19 Dec 2016 21:13:27 +0000 (00:13 +0300)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 19 Dec 2016 21:13:27 +0000 (00:13 +0300)
There is no compat (and no 32-bit version, ever) for x32 ABI, so
kernel's long type should be used for arguments' values.

The only remaining thing is a pointer to cmdline string, but it is
currently broken on x32 anyway.

* kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument
as kernel long, retrieve it via getarg_klu; use printflags64 for
printing the flags argument, retrieve it via getarg_klu.

kexec.c

diff --git a/kexec.c b/kexec.c
index bf84db93495267ef21cd5cbf10c9947020f78af0..d7054993122e1374ac3f1ef3df78555b96ff6e25 100644 (file)
--- a/kexec.c
+++ b/kexec.c
@@ -112,12 +112,12 @@ SYS_FUNC(kexec_file_load)
        printfd(tcp, tcp->u_arg[1]);
        tprints(", ");
        /* cmdline_len */
-       tprintf("%lu, ", tcp->u_arg[2]);
+       tprintf("%" PRI_klu ", ", getarg_klu(tcp, 2));
        /* cmdline */
        printstr(tcp, tcp->u_arg[3], tcp->u_arg[2]);
        tprints(", ");
        /* flags */
-       printflags_long(kexec_file_load_flags, tcp->u_arg[4], "KEXEC_FILE_???");
+       printflags64(kexec_file_load_flags, getarg_klu(tcp, 4), "KEXEC_FILE_???");
 
        return RVAL_DECODED;
 }