Giter Club home page Giter Club logo

Comments (8)

robertswiecki avatar robertswiecki commented on June 25, 2024 1

Here's import for aarch64 - google/kafel@2ae8e11

But generally, yes, argument sizes might be different between architectures - but generally the same for the same size of bitness, so it should be technically ok to use existing arm template for mips32 syscalls, and aarch64 template for mips64 sysacalls. The argument sizes are typically the same (e.g. integers, masks), just things like addresses have different bitness.

from nsjail.

robertswiecki avatar robertswiecki commented on June 25, 2024

Hm.. the whole syscall table is architecture-specific, I don't think these should be ignored, but simply added to the array?

{"sysmips",
 4149 ,
 NORMAL,
 {
         [ARG_0] = .....
 }},

Or, am I misunderstanding here? If you did mips syscall table on the basis of aarch64 or some other syscall table, then the way to go is to simply add them (at the end, or sorted, I guess it doesn't matter). We don't have any canonical syscall tables.

from nsjail.

ebadi avatar ebadi commented on June 25, 2024

I was (still am) a bit confused about few differences between naming in this table and the one used in the nsjail. Which one is correct ? or does it even matter!?
I will send a pull request soon, but please be critical about it and check it properly before merge ;) as I only have a little experience with these details. :)
Thanks

from nsjail.

ebadi avatar ebadi commented on June 25, 2024

I just noticed that my method will not work as the size of input arguments for the same syscall is different in different architectures:
accept4 in arm_syscall.c

    {"accept4",
     366,
     NORMAL,
     {
             [ARG_0] = {"fd", 4}, [ARG_1] = {"upeer_sockaddr", 4},
             [ARG_2] = {"upeer_addrlen", 4}, [ARG_3] = {"flags", 4},
     }},

accept4 in amd64_syscall.c

    {"accept4",
     288,
     NORMAL,
     {
             [ARG_0] = {"fd", 4}, [ARG_1] = {"upeer_sockaddr", 8},
             [ARG_2] = {"upeer_addrlen", 8}, [ARG_3] = {"flags", 4},
     }},

I also noticed that some syscalls that are available on all architecture are missing in kafel such as statx and pkey_mprotect. Please take a look at this: https://fedora.juszkiewicz.com.pl/syscalls.html

from nsjail.

robertswiecki avatar robertswiecki commented on June 25, 2024

In other words, if you're trying to create syscall table for mips32, please use arm_syscall template, if for mips64 please try to use aarch64 template. Then please try to remove syscalls which are not present in mips, and add syscalls which are specific to mips.

from nsjail.

ebadi avatar ebadi commented on June 25, 2024

The number of undefined syscalls in the templates are high. I should think about a better solution to generate this list!
https://github.com/ebadi/syscalls-table/blob/master/parser.py

python3 parser.py 32 mipso32
Syscall found: 294
Syscall not found 63
python3 parser.py 64 mips64
Syscall found: 239
Syscall not found 85

from nsjail.

robertswiecki avatar robertswiecki commented on June 25, 2024

What about manually checking (at least some rudumentaty check) with

https://github.com/torvalds/linux/blob/master/arch/mips/kernel/scall64-64.S

and

https://github.com/torvalds/linux/blob/master/arch/mips/kernel/scall32-o32.S

Given that we don't have tables for mips yet, I think we could marge your tables as-is, given that it passes this rudimentary/manual check (total number of syscalls, a few examples of syscalls and their numbers in your table), and fix any eventual problems later on?

from nsjail.

ebadi avatar ebadi commented on June 25, 2024

I cleaned up my code here and did a quick check to make sure that syscall numbers match with the links you provided. Please take a look at the result

from nsjail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.