android-8.1.0_r81 patches
This commit is contained in:
32
android-8.1.0_r81/external/minijail/0001-disable-seccomp.patch
vendored
Normal file
32
android-8.1.0_r81/external/minijail/0001-disable-seccomp.patch
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
From 61b90544806f777c5bacf2fc1a1542154f3fad75 Mon Sep 17 00:00:00 2001
|
||||
From: Ziyang Zhou <ziyang.zhou@outlook.com>
|
||||
Date: Mon, 26 Apr 2021 22:55:03 +0800
|
||||
Subject: [PATCH] disable seccomp
|
||||
|
||||
---
|
||||
libminijail.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/libminijail.c b/libminijail.c
|
||||
index 4d61b0d..660b583 100644
|
||||
--- a/libminijail.c
|
||||
+++ b/libminijail.c
|
||||
@@ -1580,6 +1580,7 @@ static void set_seccomp_filter(const struct minijail *j)
|
||||
/*
|
||||
* Install the syscall filter.
|
||||
*/
|
||||
+#if 0 // HACKED
|
||||
if (j->flags.seccomp_filter) {
|
||||
if (j->flags.seccomp_filter_tsync) {
|
||||
if (sys_seccomp(SECCOMP_SET_MODE_FILTER,
|
||||
@@ -1594,6 +1595,7 @@ static void set_seccomp_filter(const struct minijail *j)
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
static pid_t forward_pid = -1;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
200
android-8.1.0_r81/external/selinux/0001-ignore-selinux.patch
vendored
Normal file
200
android-8.1.0_r81/external/selinux/0001-ignore-selinux.patch
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
From 6fd28b726a9ce3060d377e0f1c722da705b51acd Mon Sep 17 00:00:00 2001
|
||||
From: Ziyang Zhou <ziyang.zhou@outlook.com>
|
||||
Date: Sun, 9 May 2021 23:12:46 +0800
|
||||
Subject: [PATCH] ignore selinux
|
||||
|
||||
---
|
||||
libselinux/include/selinux/selinux.h | 4 ++++
|
||||
libselinux/src/android/android_platform.c | 6 ++++++
|
||||
libselinux/src/checkAccess.c | 1 +
|
||||
libselinux/src/getenforce.c | 1 +
|
||||
libselinux/src/getpeercon.c | 1 +
|
||||
libselinux/src/init.c | 1 +
|
||||
libselinux/src/label.c | 2 ++
|
||||
libselinux/src/lgetfilecon.c | 1 +
|
||||
libselinux/src/lsetfilecon.c | 1 +
|
||||
libselinux/src/procattr.c | 2 ++
|
||||
10 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h
|
||||
index 01201eee..86db8297 100644
|
||||
--- a/libselinux/include/selinux/selinux.h
|
||||
+++ b/libselinux/include/selinux/selinux.h
|
||||
@@ -4,6 +4,10 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
+#define SE_HACK
|
||||
+#define se_hack() if (1) return
|
||||
+#define se_hack1(p) if (1) return p
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
diff --git a/libselinux/src/android/android_platform.c b/libselinux/src/android/android_platform.c
|
||||
index 0325113e..868255d1 100644
|
||||
--- a/libselinux/src/android/android_platform.c
|
||||
+++ b/libselinux/src/android/android_platform.c
|
||||
@@ -135,6 +135,7 @@ static bool selinux_android_opts_file_exists(const struct selinux_opt *opt)
|
||||
|
||||
struct selabel_handle* selinux_android_file_context_handle(void)
|
||||
{
|
||||
+ se_hack1(NULL);
|
||||
if (selinux_android_opts_file_exists(seopts_file_split)) {
|
||||
return selinux_android_file_context(seopts_file_split,
|
||||
ARRAY_SIZE(seopts_file_split));
|
||||
@@ -146,6 +147,7 @@ struct selabel_handle* selinux_android_file_context_handle(void)
|
||||
|
||||
struct selabel_handle* selinux_android_prop_context_handle(void)
|
||||
{
|
||||
+ se_hack1(NULL);
|
||||
struct selabel_handle* sehandle;
|
||||
const struct selinux_opt* seopts_prop;
|
||||
|
||||
@@ -1040,6 +1042,7 @@ oom:
|
||||
|
||||
int selinux_android_setcon(const char *con)
|
||||
{
|
||||
+ se_hack1(0);
|
||||
int ret = setcon(con);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1056,6 +1059,7 @@ int selinux_android_setcontext(uid_t uid,
|
||||
const char *seinfo,
|
||||
const char *pkgname)
|
||||
{
|
||||
+ se_hack1(0);
|
||||
char *orig_ctx_str = NULL, *ctx_str;
|
||||
context_t ctx = NULL;
|
||||
int rc = -1;
|
||||
@@ -1394,6 +1398,7 @@ static int selinux_android_restorecon_common(const char* pathname_orig,
|
||||
uid_t uid,
|
||||
unsigned int flags)
|
||||
{
|
||||
+ se_hack1(0);
|
||||
bool nochange = (flags & SELINUX_ANDROID_RESTORECON_NOCHANGE) ? true : false;
|
||||
bool verbose = (flags & SELINUX_ANDROID_RESTORECON_VERBOSE) ? true : false;
|
||||
bool recurse = (flags & SELINUX_ANDROID_RESTORECON_RECURSE) ? true : false;
|
||||
@@ -1607,6 +1612,7 @@ void selinux_android_set_sehandle(const struct selabel_handle *hndl)
|
||||
|
||||
int selinux_android_load_policy()
|
||||
{
|
||||
+ se_hack1(0);
|
||||
int fd = -1;
|
||||
|
||||
fd = open(sepolicy_file, O_RDONLY | O_NOFOLLOW | O_CLOEXEC);
|
||||
diff --git a/libselinux/src/checkAccess.c b/libselinux/src/checkAccess.c
|
||||
index 8de57477..e1048d83 100644
|
||||
--- a/libselinux/src/checkAccess.c
|
||||
+++ b/libselinux/src/checkAccess.c
|
||||
@@ -33,6 +33,7 @@ static void avc_init_once(void)
|
||||
}
|
||||
|
||||
int selinux_check_access(const char *scon, const char *tcon, const char *class, const char *perm, void *aux) {
|
||||
+ se_hack1(0);
|
||||
int rc;
|
||||
security_id_t scon_id;
|
||||
security_id_t tcon_id;
|
||||
diff --git a/libselinux/src/getenforce.c b/libselinux/src/getenforce.c
|
||||
index d909dced..fb782b77 100644
|
||||
--- a/libselinux/src/getenforce.c
|
||||
+++ b/libselinux/src/getenforce.c
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
int security_getenforce(void)
|
||||
{
|
||||
+ se_hack1(0);
|
||||
int fd, ret, enforce = 0;
|
||||
char path[PATH_MAX];
|
||||
char buf[20];
|
||||
diff --git a/libselinux/src/getpeercon.c b/libselinux/src/getpeercon.c
|
||||
index 3a77a2de..f8dab8e5 100644
|
||||
--- a/libselinux/src/getpeercon.c
|
||||
+++ b/libselinux/src/getpeercon.c
|
||||
@@ -47,6 +47,7 @@ hidden_def(getpeercon_raw)
|
||||
|
||||
int getpeercon(int fd, char ** context)
|
||||
{
|
||||
+ se_hack1((*context = calloc(7, 1), memcpy(*context, "HACKED", 6), 0));
|
||||
int ret;
|
||||
char * rcontext;
|
||||
|
||||
diff --git a/libselinux/src/init.c b/libselinux/src/init.c
|
||||
index 2690a72f..24a212db 100644
|
||||
--- a/libselinux/src/init.c
|
||||
+++ b/libselinux/src/init.c
|
||||
@@ -142,6 +142,7 @@ hidden_def(fini_selinuxmnt)
|
||||
|
||||
void set_selinuxmnt(const char *mnt)
|
||||
{
|
||||
+ se_hack();
|
||||
selinux_mnt = strdup(mnt);
|
||||
}
|
||||
|
||||
diff --git a/libselinux/src/label.c b/libselinux/src/label.c
|
||||
index 8e0a8628..c3ba37bd 100644
|
||||
--- a/libselinux/src/label.c
|
||||
+++ b/libselinux/src/label.c
|
||||
@@ -390,6 +390,7 @@ out:
|
||||
int selabel_lookup(struct selabel_handle *rec, char **con,
|
||||
const char *key, int type)
|
||||
{
|
||||
+ se_hack1((*con = calloc(7, 1), memcpy(*con, "HACKED", 6), 0));
|
||||
struct selabel_lookup_rec *lr;
|
||||
|
||||
lr = selabel_lookup_common(rec, 1, key, type);
|
||||
@@ -440,6 +441,7 @@ bool selabel_partial_match(struct selabel_handle *rec, const char *key)
|
||||
int selabel_lookup_best_match(struct selabel_handle *rec, char **con,
|
||||
const char *key, const char **aliases, int type)
|
||||
{
|
||||
+ se_hack1((*con = calloc(7, 1), memcpy(*con, "HACKED", 6), 0));
|
||||
struct selabel_lookup_rec *lr;
|
||||
|
||||
if (!rec->func_lookup_best_match) {
|
||||
diff --git a/libselinux/src/lgetfilecon.c b/libselinux/src/lgetfilecon.c
|
||||
index db67bc60..7123480f 100644
|
||||
--- a/libselinux/src/lgetfilecon.c
|
||||
+++ b/libselinux/src/lgetfilecon.c
|
||||
@@ -53,6 +53,7 @@ hidden_def(lgetfilecon_raw)
|
||||
|
||||
int lgetfilecon(const char *path, char ** context)
|
||||
{
|
||||
+ se_hack1((*context = calloc(7, 1), memcpy(*context, "HACKED", 6), 0));
|
||||
int ret;
|
||||
char * rcontext = NULL;
|
||||
|
||||
diff --git a/libselinux/src/lsetfilecon.c b/libselinux/src/lsetfilecon.c
|
||||
index 1d3b28a1..7062703f 100644
|
||||
--- a/libselinux/src/lsetfilecon.c
|
||||
+++ b/libselinux/src/lsetfilecon.c
|
||||
@@ -29,6 +29,7 @@ hidden_def(lsetfilecon_raw)
|
||||
|
||||
int lsetfilecon(const char *path, const char *context)
|
||||
{
|
||||
+ se_hack1(0);
|
||||
int ret;
|
||||
char * rcontext;
|
||||
|
||||
diff --git a/libselinux/src/procattr.c b/libselinux/src/procattr.c
|
||||
index 48dd8aff..ab516e2a 100644
|
||||
--- a/libselinux/src/procattr.c
|
||||
+++ b/libselinux/src/procattr.c
|
||||
@@ -184,6 +184,7 @@ static int getprocattrcon_raw(char ** context,
|
||||
static int getprocattrcon(char ** context,
|
||||
pid_t pid, const char *attr)
|
||||
{
|
||||
+ se_hack1((*context = calloc(7, 1), memcpy(*context, "HACKED", 6), 0));
|
||||
int ret;
|
||||
char * rcontext;
|
||||
|
||||
@@ -269,6 +270,7 @@ out:
|
||||
static int setprocattrcon(const char * context,
|
||||
pid_t pid, const char *attr)
|
||||
{
|
||||
+ se_hack1(0);
|
||||
int ret;
|
||||
char * rcontext;
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
22
android-8.1.0_r81/external/swiftshader/0001-fix-build.patch
vendored
Normal file
22
android-8.1.0_r81/external/swiftshader/0001-fix-build.patch
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
From afc19bc44441c9eaadcbee6c1b60f07bdfbda0ba Mon Sep 17 00:00:00 2001
|
||||
From: Ziyang Zhou <ziyang.zhou@outlook.com>
|
||||
Date: Sun, 27 Feb 2022 19:18:27 +0800
|
||||
Subject: [PATCH] fix build
|
||||
|
||||
---
|
||||
Android.bp | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/Android.bp b/Android.bp
|
||||
index b81c37c0f..e122a3404 100644
|
||||
--- a/Android.bp
|
||||
+++ b/Android.bp
|
||||
@@ -105,5 +105,4 @@ subdirs = [
|
||||
"src",
|
||||
"third_party/llvm-subzero",
|
||||
"third_party/LLVM",
|
||||
- "third_party/subzero",
|
||||
]
|
||||
--
|
||||
2.34.1
|
||||
|
||||
Reference in New Issue
Block a user