[strace/strace] tests: modify_ldt failed in x86_64 (#118)

xuchunmei000 notifications at github.com
Thu Jan 16 02:14:10 UTC 2020


my kernel version is 4.19 with CONFIG_MODIFY_LDT_SYSCALL not set, x86_64 arch
the case modify_ldt is failed:
[root at AliYun tests]# ./modify_ldt.gen.test
../../strace: umoven: short read (4 < 16) @0x7fdd4f36affc: Input/output error
--- exp	2020-01-16 10:11:46.855387179 +0800
+++ log	2020-01-16 10:11:46.855387179 +0800
@@ -1,10 +1,9 @@
-__NR_modify_ldt=154
-modify_ldt(0, NULL, 0) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, 0xffffffffffffffff, 16045756814261206767) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, 0x7fdd4f537000, 0) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, 0x7fdd4f536ff0, 42) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, 0x7fdd4f537000, 16) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, 0x7fdd4f36affc, 16) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, {entry_number=2206368128, base_addr=0x87868584, limit=0x8b8a8988, seg_32bit=0, contents=2, read_exec_only=1, limit_in_pages=0, seg_not_present=0, useable=0, lm=1}, 16) = -1 EPERM (Operation not permitted)
-modify_ldt(-629534633, {entry_number=-1, base_addr=00000000, limit=00000000, seg_32bit=1, contents=0, read_exec_only=0, limit_in_pages=0, seg_not_present=1, useable=1, lm=0}, 16) = -1 EPERM (Operation not permitted)
+modify_ldt(0, NULL, 0) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, 0xffffffffffffffff, 16045756814261206767) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, 0x7fdd4f537000, 0) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, 0x7fdd4f536ff0, 42) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, 0x7fdd4f537000, 16) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, 0x7fdd4f36affc, 16) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, {entry_number=2206368128, base_addr=0x87868584, limit=0x8b8a8988, seg_32bit=0, contents=2, read_exec_only=1, limit_in_pages=0, seg_not_present=0, useable=0, lm=1}, 16) = -1 ENOSYS (Function not implemented)
+modify_ldt(-629534633, {entry_number=-1, base_addr=00000000, limit=00000000, seg_32bit=1, contents=0, read_exec_only=0, limit_in_pages=0, seg_not_present=1, useable=1, lm=0}, 16) = -1 ENOSYS (Function not implemented)
 +++ exited with 0 +++
modify_ldt.gen.test: failed test: ../../strace -e trace=modify_ldt -a23 ../modify_ldt output mismatch

I find in modify_ldt.c the printrc do something to the errno, can someone tell me why
void
printrc(long rc)
{
#ifdef __x86_64__
        int err = -rc;

        /* Thanks, long return type of syscall(2) */
        printf("%lld", zero_extend_signed_to_ull(rc));

        **if (err > 0 && err < 0x1000) {
                errno = err;
                printf(" %s (%m)", errno2name());
        }**
#else
        printf("%s", sprintrc(rc));
#endif

        puts("");
}


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/strace/strace/issues/118
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20200116/41fc64af/attachment.html>


More information about the Strace-devel mailing list