gpt4 book ai didi

android - 奥利奥 : how to find all restricted syscalls at source code?

转载 作者:行者123 更新时间:2023-12-04 12:03:41 26 4
gpt4 key购买 nike

https://android-developers.googleblog.com/2017/07/seccomp-filter-in-android-o.html

正如本文的“seccomp 过滤器”部分所说,

Android O's seccomp filter blocks certain syscalls, such as swapon/swapoff, which have been implicated in some security attacks, and the key control syscalls, which are not useful to apps. In total, the filter blocks 17 of 271 syscalls in arm64 and 70 of 364 in arm.



现在,一些系统调用被阻塞并抛出错误 signal 31 (SIGSYS), code 1 (SYS_SECCOMP), fault addr -------- Cause: seccomp prevented call to disallowed system call 55 .

但是我在 arm64 中找不到 17 个系统调用和 arm 中的 70 个系统调用的上述列表。
哪些系统调用受到限制?如何找到导致崩溃的系统调用?

已编辑:

似乎此错误消息是在此处生成的。

https://github.com/aosp-mirror/platform_system_core/blob/master/debuggerd/libdebuggerd/tombstone.cpp#L96
  } else if (si->si_signo == SIGSYS && si->si_code == SYS_SECCOMP) {
cause = StringPrintf("seccomp prevented call to disallowed %s system call %d", ABI_STRING,
si->si_syscall);
}

最佳答案

哪些系统调用在 Android 8.0 Oreo 中受到限制?
系统调用过滤器 source files是自动生成的,但生成过滤器的文本文件位于 the next directory up .在这里我们找到了一个 list of all syscalls of interest ,以及几个白名单和黑名单。大概是app blacklist是您正在寻找的;我总结如下。
编辑:系统调用过滤背景
过滤本身是 Linux 内核提供的标准特性,称为 seccomp . AOSP 所做的就是利用此功能过滤上面链接的应用黑名单中列出的系统调用。一个脚本将该黑名单处理到特定于平台的自动生成的过滤器中,然后将其提供给 seccomp,用于启动所有 Android 应用程序的进程(即 Zygote)。一旦此过滤处于 Activity 状态,从过滤的进程(即任何应用程序)进行匹配的系统调用将导致 SIGKILL signal正在交付。见 here有关 Linux 信号的一些一般信息。您链接的 AOSP 源打印的错误消息只是系统在注意到您的进程被终止时试图为您提供一些有用信息 - 请注意方法名称是 dump_probable_cause .
阻止系统调用以修改 ID
+------------------------------------------------- -+---------------------------+
|功能 |已阻止 |
+------------------------------------------------- -+---------------------------+
| int setgid:setgid32(gid_t) | ARM ,x86 |
| int setgid:setgid(gid_t) | arm64,mips,mips64,x86_64 |
| int setuid:setuid32(uid_t) | ARM ,x86 |
| int setuid:setuid(uid_t) | arm64,mips,mips64,x86_64 |
| int setreuid:setreuid32(uid_t, uid_t) | ARM ,x86 |
| int setreuid:setreuid(uid_t, uid_t) | arm64,mips,mips64,x86_64 |
| int setresuid:setresuid32(uid_t, uid_t, uid_t) | ARM ,x86 |
| int setresuid:setresuid(uid_t, uid_t, uid_t) | arm64,mips,mips64,x86_64 |
| int setresgid:setresgid32(gid_t, gid_t, gid_t) | ARM ,x86 |
| int setresgid:setresgid(gid_t, gid_t, gid_t) | arm64,mips,mips64,x86_64 |
| int setfsgid(gid_t) |所有 |
| int setfsuid(uid_t) |所有 |
| int setgroups:setgroups32(int, const gid_t*) | ARM ,x86 |
| int setgroups:setgroups(int, const gid_t*) | arm64,mips,mips64,x86_64 |
+------------------------------------------------- -+---------------------------+

阻止系统调用以修改时间
+------------------------------------------------- --------------------+------------+
|功能 |已阻止 |
+------------------------------------------------- --------------------+------------+
| int adjtimex(struct timex*) |所有 |
| int clock_adjtime(clockid_t, struct timex*) |所有 |
| int clock_settime(clockid_t, const struct timespec*) |所有 |
| int settimeofday(const struct timeval*, const struct timezone*) |所有 |
| int acct(const char* 文件路径) |所有 |
| int klogctl:syslog(int, char*, int) |所有 |
| int capset(cap_user_header_t 头,const cap_user_data_t 数据) |所有 |
| int chroot(const char*) |所有 |
+------------------------------------------------- --------------------+------------+

阻止系统调用以更改各种机器配置
+------------------------------------------------- -------------------------------+------------+
|功能 |已阻止 |
+------------------------------------------------- -------------------------------+------------+
| int init_module(void*, unsigned long, const char*) |所有 |
| int delete_module(const char*, unsigned int) |所有 |
| int mount(const char*, const char*, const char*, unsigned long, const void*) |所有 |
| int umount2(const char*, int) |所有 |
| int swapon(const char*, int) |所有 |
| int swapoff(const char*) |所有 |
| int setdomainname(const char*, size_t) |所有 |
| int sethostname(const char*, size_t) |所有 |
| int __reboot:reboot(int, int, int, void*) |所有 |
+------------------------------------------------- -------------------------------+------------+

关于android - 奥利奥 : how to find all restricted syscalls at source code?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48802321/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com