Skip to content

Can't mount generated testcase iso image (tmp.img) and can't compile generated testcase program (tmp.c) #6

@TejasDuseja

Description

@TejasDuseja

Unable to mount generated testcase iso image. Error says bad superblock.
Unable to run tmp.c error says
tmp.c:34:10: error: use of undeclared identifier 'SYS_newlstat'
syscall(SYS_newlstat, (long)v3, (long)v1);
^
tmp.c:35:10: error: use of undeclared identifier 'SYS_newstat'
syscall(SYS_newstat, (long)v5, (long)v1);
^
2 errors generated.

Activity

uestcmahone

uestcmahone commented on Mar 27, 2020

@uestcmahone

I have encountered the same problem. Any solutions or interpretation?

peng-hui

peng-hui commented on Mar 7, 2022

@peng-hui

Janus directly uses system call constants (e.g., SYS_read) defined in sys/syscall.h. The PoC generation part applies the syscall constant as an index to fetch syscall_name defined in Constants.cpp. By checking the syscall contants defined in /usr/include/x86_64-linux-gnu/asm/unistd_64.h, I found the SYS_newlstat, SYS_newstat, and SYS_newfstat should be updated as SYS_lstat, SYS_stat, and SYS_fstat, respectively, in Constants.cpp to comform the system definition. In other words, just remove the prefix new to use correct system calls.

(However, I still could not reproduce crashes on my VM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @TejasDuseja@peng-hui@uestcmahone

        Issue actions

          Can't mount generated testcase iso image (tmp.img) and can't compile generated testcase program (tmp.c) · Issue #6 · sslab-gatech/janus