Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscalls/mmap04: Validate mapping perms in /proc/self/maps #7

Closed
wants to merge 1 commit into from

Conversation

Avinesh
Copy link
Owner

@Avinesh Avinesh commented Sep 5, 2023

No description provided.

Validating the various combinations of prot+flags arguments in mmap()
call and parsing the /proc/self/maps file to verifying resulting mapping
has the permission bits as requested in mmap() call.

Signed-off-by: Avinesh Kumar <[email protected]>
Avinesh pushed a commit that referenced this pull request Nov 20, 2023
63e8c1e introduced a regression on 32 bit compilation when compiled
with -fstack-protector-strong, because struct timespec is probably too
small for timespec64.

    PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig CFLAGS="-m32 -fstack-protector-strong" LDFLAGS="-m32 -fstack-protector-strong" ./configure
    ...
    # gdb ./abort01
    (gdb) set follow-fork-mode child
    (gdb) run
    Starting program: testcases/kernel/syscalls/abort/abort01
    Missing separate debuginfos, use: zypper install glibc-32bit-debuginfo-2.31-150300.52.2.x86_64
    tst_test.c:1690: TINFO: LTP version: 20230929-7-gff6cdc67f
    tst_test.c:1576: TINFO: Timeout per run is 0h 00m 30s
    [Attaching after process 3357 fork to child process 3360]
    [New inferior 2 (process 3360)]
    [Detaching after fork from parent process 3357]
    [Inferior 1 (process 3357) detached]
    *** stack smashing detected ***: terminated

    Thread 2.1 "abort01" received signal SIGABRT, Aborted.
    [Switching to process 3360]
    0xf7fd2559 in __kernel_vsyscall ()
    (gdb) bt
    #0  0xf7fd2559 in __kernel_vsyscall ()
    #1  0xf7e08aa2 in raise () from /lib/libc.so.6
    #2  0xf7e09efd in abort () from /lib/libc.so.6
    #3  0xf7e4d91b in __libc_message () from /lib/libc.so.6
    #4  0xf7eeb2cc in __fortify_fail () from /lib/libc.so.6
    #5  0xf7eeb299 in __stack_chk_fail () from /lib/libc.so.6
    #6  0x0805c501 in syscall_supported_by_kernel (sysnr=403) at tst_clocks.c:27
    #7  0x0805c80d in tst_clock_gettime (clk_id=1, ts=0x807cfb0 <tst_start_time>) at tst_clocks.c:66
    #8  0x080531df in heartbeat () at tst_test.c:1374
    #9  0x08053ba2 in testrun () at tst_test.c:1458
    #10 fork_testrun () at tst_test.c:1608
    #11 0x08055afa in tst_run_tcases (argc=<optimized out>, argv=<optimized out>, self=<optimized out>) at tst_test.c:1704
    #12 0x0804b3f0 in main (argc=1, argv=0xffffc414) at ../../../../include/tst_test.h:401
    (gdb) Test timeouted, sending SIGKILL!
    Test timeouted, sending SIGKILL!

Fixes: 63e8c1e ("tst_clocks: Fix unaddressable byte warning")
Reported-by: Petr Cervinka <[email protected]>
Suggested-by: Cyril Hrubis <[email protected]>
Reviewed-by: Marius Kittler <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
@Avinesh Avinesh closed this Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant