2023-07-07 22:52:22 +00:00
|
|
|
From be7a0019f698b236692d06f6beff99d44f3802b5 Mon Sep 17 00:00:00 2001
|
2021-03-04 15:12:32 +00:00
|
|
|
From: Ben Hutchings <ben@decadent.org.uk>
|
|
|
|
Date: Mon, 7 Sep 2020 02:51:53 +0100
|
|
|
|
Subject: [PATCH 1/2] Export symbols needed by Android drivers
|
|
|
|
|
|
|
|
We want to enable use of the Android ashmem and binder drivers to
|
|
|
|
support Anbox, but they should not be built-in as that would waste
|
|
|
|
resources and increase security attack surface on systems that don't
|
|
|
|
need them.
|
|
|
|
|
|
|
|
Export the currently un-exported symbols they depend on.
|
|
|
|
---
|
|
|
|
fs/file.c | 1 +
|
|
|
|
kernel/sched/core.c | 1 +
|
2021-12-30 23:32:37 +00:00
|
|
|
kernel/sched/wait.c | 1 +
|
2021-03-04 15:12:32 +00:00
|
|
|
kernel/task_work.c | 1 +
|
|
|
|
mm/memory.c | 1 +
|
|
|
|
mm/shmem.c | 1 +
|
|
|
|
security/security.c | 4 ++++
|
2022-09-22 02:13:36 +00:00
|
|
|
7 files changed, 10 insertions(+)
|
2021-03-04 15:12:32 +00:00
|
|
|
|
|
|
|
diff --git a/fs/file.c b/fs/file.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index 7893ea161d77..066f90a4f572 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/fs/file.c
|
|
|
|
+++ b/fs/file.c
|
2023-05-11 14:10:32 +00:00
|
|
|
@@ -814,6 +814,7 @@ struct file *close_fd_get_file(unsigned int fd)
|
2021-11-20 03:36:23 +00:00
|
|
|
|
2022-08-19 21:25:41 +00:00
|
|
|
return file;
|
2021-03-04 15:12:32 +00:00
|
|
|
}
|
2021-11-20 03:36:23 +00:00
|
|
|
+EXPORT_SYMBOL_GPL(close_fd_get_file);
|
2021-03-04 15:12:32 +00:00
|
|
|
|
2021-11-20 03:36:23 +00:00
|
|
|
void do_close_on_exec(struct files_struct *files)
|
|
|
|
{
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index a68d1276bab0..5e5adf3f4f49 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/kernel/sched/core.c
|
|
|
|
+++ b/kernel/sched/core.c
|
2023-07-07 22:52:22 +00:00
|
|
|
@@ -7227,6 +7227,7 @@ static bool is_nice_reduction(const struct task_struct *p, const int nice)
|
2022-10-14 15:36:01 +00:00
|
|
|
|
|
|
|
return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
|
2021-03-04 15:12:32 +00:00
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(can_nice);
|
|
|
|
|
2022-10-14 15:36:01 +00:00
|
|
|
/*
|
|
|
|
* can_nice - check if a task can reduce its nice value
|
2021-12-30 23:32:37 +00:00
|
|
|
diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index 133b74730738..a2a3381ede73 100644
|
2021-12-30 23:32:37 +00:00
|
|
|
--- a/kernel/sched/wait.c
|
|
|
|
+++ b/kernel/sched/wait.c
|
2023-05-11 14:10:32 +00:00
|
|
|
@@ -247,6 +247,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
|
2021-12-30 23:32:37 +00:00
|
|
|
/* POLLFREE must have cleared the queue. */
|
|
|
|
WARN_ON_ONCE(waitqueue_active(wq_head));
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Note: we use "set_current_state()" _after_ the wait-queue add,
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/kernel/task_work.c b/kernel/task_work.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index 065e1ef8fc8d..7d06ea82a53e 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/kernel/task_work.c
|
|
|
|
+++ b/kernel/task_work.c
|
2022-08-19 21:25:41 +00:00
|
|
|
@@ -73,6 +73,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
|
2021-03-04 15:12:32 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2021-11-20 03:36:23 +00:00
|
|
|
+EXPORT_SYMBOL_GPL(task_work_add);
|
2021-03-04 15:12:32 +00:00
|
|
|
|
|
|
|
/**
|
2021-07-21 02:09:14 +00:00
|
|
|
* task_work_cancel_match - cancel a pending work added by task_work_add()
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/mm/memory.c b/mm/memory.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index 5ce82a76201d..c20d92584f25 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/mm/memory.c
|
|
|
|
+++ b/mm/memory.c
|
2023-07-07 22:52:22 +00:00
|
|
|
@@ -1755,6 +1755,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
|
2021-03-04 15:12:32 +00:00
|
|
|
mmu_notifier_invalidate_range_end(&range);
|
2021-07-21 02:09:14 +00:00
|
|
|
tlb_finish_mmu(&tlb);
|
2021-03-04 15:12:32 +00:00
|
|
|
}
|
2023-05-11 14:10:32 +00:00
|
|
|
+EXPORT_SYMBOL_GPL(zap_page_range_single);
|
2021-03-04 15:12:32 +00:00
|
|
|
|
|
|
|
/**
|
2023-05-11 14:10:32 +00:00
|
|
|
* zap_vma_ptes - remove ptes mapping the vma
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/mm/shmem.c b/mm/shmem.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index e40a08c5c6d7..3082bd4dfd52 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/mm/shmem.c
|
|
|
|
+++ b/mm/shmem.c
|
2023-07-07 22:52:22 +00:00
|
|
|
@@ -4351,6 +4351,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
|
2021-03-04 15:12:32 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(shmem_zero_setup);
|
|
|
|
|
|
|
|
/**
|
2023-05-11 14:10:32 +00:00
|
|
|
* shmem_read_folio_gfp - read into page cache, using specified page allocation flags.
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/security/security.c b/security/security.c
|
2023-07-07 22:52:22 +00:00
|
|
|
index d5ff7ff45b77..79cc02ff5971 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/security/security.c
|
|
|
|
+++ b/security/security.c
|
2023-07-07 22:52:22 +00:00
|
|
|
@@ -798,6 +798,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
|
2021-03-04 15:12:32 +00:00
|
|
|
{
|
|
|
|
return call_int_hook(binder_set_context_mgr, 0, mgr);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
|
|
|
|
|
2023-07-07 22:52:22 +00:00
|
|
|
/**
|
|
|
|
* security_binder_transaction() - Check if a binder transaction is allowed
|
|
|
|
@@ -813,6 +814,7 @@ int security_binder_transaction(const struct cred *from,
|
2021-03-04 15:12:32 +00:00
|
|
|
{
|
|
|
|
return call_int_hook(binder_transaction, 0, from, to);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(security_binder_transaction);
|
|
|
|
|
2023-07-07 22:52:22 +00:00
|
|
|
/**
|
|
|
|
* security_binder_transfer_binder() - Check if a binder transfer is allowed
|
|
|
|
@@ -828,6 +830,7 @@ int security_binder_transfer_binder(const struct cred *from,
|
2021-03-04 15:12:32 +00:00
|
|
|
{
|
|
|
|
return call_int_hook(binder_transfer_binder, 0, from, to);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
|
|
|
|
|
2023-07-07 22:52:22 +00:00
|
|
|
/**
|
|
|
|
* security_binder_transfer_file() - Check if a binder file xfer is allowed
|
|
|
|
@@ -844,6 +847,7 @@ int security_binder_transfer_file(const struct cred *from,
|
2021-03-04 15:12:32 +00:00
|
|
|
{
|
|
|
|
return call_int_hook(binder_transfer_file, 0, from, to, file);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
|
|
|
|
|
2023-07-07 22:52:22 +00:00
|
|
|
/**
|
|
|
|
* security_ptrace_access_check() - Check if tracing is allowed
|
2021-03-04 15:12:32 +00:00
|
|
|
--
|
2023-07-07 22:52:22 +00:00
|
|
|
2.41.0
|
2021-03-04 15:12:32 +00:00
|
|
|
|