1
0
Files
linux/debian/patches/debian/export-symbols-needed-by-binder.patch
2025-08-15 15:46:56 +03:00

154 lines
4.2 KiB
Diff

From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 08 Jul 2025 13:32:21 +0200
Subject: Export symbols needed by binder
Bug-Debian: https://bugs.debian.org/901492
We want to enable use of the Android binder driver to support
Waydroid, but it should not be built-in as that would waste resources
and increase security attack surface on systems that don't need it.
Export the currently un-exported symbols it depends on.
---
fs/file.c | 1 +
ipc/msgutil.c | 1 +
ipc/namespace.c | 1 +
kernel/sched/syscalls.c | 1 +
kernel/sched/wait.c | 1 +
kernel/task_work.c | 1 +
mm/list_lru.c | 2 ++
mm/memory.c | 2 ++
security/security.c | 4 ++++
9 files changed, 14 insertions(+)
--- a/fs/file.c
+++ b/fs/file.c
@@ -843,6 +843,7 @@ struct file *file_close_fd(unsigned int
return file;
}
+EXPORT_SYMBOL_GPL(file_close_fd);
void do_close_on_exec(struct files_struct *files)
{
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -33,6 +33,7 @@ struct ipc_namespace init_ipc_ns = {
.ns.ops = &ipcns_operations,
#endif
};
+EXPORT_SYMBOL_GPL(init_ipc_ns);
struct msg_msgseg {
struct msg_msgseg *next;
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -207,6 +207,7 @@ void put_ipc_ns(struct ipc_namespace *ns
schedule_work(&free_ipc_work);
}
}
+EXPORT_SYMBOL_GPL(put_ipc_ns);
static inline struct ipc_namespace *to_ipc_ns(struct ns_common *ns)
{
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -140,6 +140,7 @@ int can_nice(const struct task_struct *p
{
return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
}
+EXPORT_SYMBOL_GPL(can_nice);
#ifdef __ARCH_WANT_SYS_NICE
--- a/kernel/sched/wait.c
+++ b/kernel/sched/wait.c
@@ -212,6 +212,7 @@ void __wake_up_pollfree(struct wait_queu
/* 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,
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -96,6 +96,7 @@ int task_work_add(struct task_struct *ta
return 0;
}
+EXPORT_SYMBOL_GPL(task_work_add);
/**
* task_work_cancel_match - cancel a pending work added by task_work_add()
--- a/mm/list_lru.c
+++ b/mm/list_lru.c
@@ -175,6 +175,7 @@ bool list_lru_add(struct list_lru *lru,
unlock_list_lru(l, false);
return false;
}
+EXPORT_SYMBOL_GPL(list_lru_add);
bool list_lru_add_obj(struct list_lru *lru, struct list_head *item)
{
@@ -212,6 +213,7 @@ bool list_lru_del(struct list_lru *lru,
unlock_list_lru(l, false);
return false;
}
+EXPORT_SYMBOL_GPL(list_lru_del);
bool list_lru_del_obj(struct list_lru *lru, struct list_head *item)
{
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2020,6 +2020,7 @@ void zap_page_range_single(struct vm_are
tlb_finish_mmu(&tlb);
hugetlb_zap_end(vma, details);
}
+EXPORT_SYMBOL_GPL(zap_page_range_single);
/**
* zap_vma_ptes - remove ptes mapping the vma
@@ -6567,6 +6568,7 @@ inval:
count_vm_vma_lock_event(VMA_LOCK_ABORT);
return NULL;
}
+EXPORT_SYMBOL_GPL(lock_vma_under_rcu);
#endif /* CONFIG_PER_VMA_LOCK */
#ifndef __PAGETABLE_P4D_FOLDED
--- a/security/security.c
+++ b/security/security.c
@@ -996,6 +996,7 @@ int security_binder_set_context_mgr(cons
{
return call_int_hook(binder_set_context_mgr, mgr);
}
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
/**
* security_binder_transaction() - Check if a binder transaction is allowed
@@ -1011,6 +1012,7 @@ int security_binder_transaction(const st
{
return call_int_hook(binder_transaction, from, to);
}
+EXPORT_SYMBOL_GPL(security_binder_transaction);
/**
* security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -1026,6 +1028,7 @@ int security_binder_transfer_binder(cons
{
return call_int_hook(binder_transfer_binder, from, to);
}
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
/**
* security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -1042,6 +1045,7 @@ int security_binder_transfer_file(const
{
return call_int_hook(binder_transfer_file, from, to, file);
}
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
/**
* security_ptrace_access_check() - Check if tracing is allowed