Export symbols needed by binder
authorBen Hutchings <ben@decadent.org.uk>
Tue, 8 Jul 2025 11:32:21 +0000 (13:32 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 20 Dec 2025 09:15:48 +0000 (10:15 +0100)
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.

Gbp-Pq: Topic debian
Gbp-Pq: Name export-symbols-needed-by-binder.patch

fs/file.c
ipc/msgutil.c
ipc/namespace.c
kernel/sched/syscalls.c
kernel/sched/wait.c
kernel/task_work.c
mm/list_lru.c
mm/memory.c
mm/mmap_lock.c
security/security.c

index 28743b742e3cf65b36227033d4e3ecd643108bd3..d030787add367de24986abff62fce16ea8dbb202 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -858,6 +858,7 @@ struct file *file_close_fd(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(file_close_fd);
 
 void do_close_on_exec(struct files_struct *files)
 {
index c7be0c79264767b74d6f3c716af16366034ceb1e..6306109822e447620813e29e8f6a53b569060a28 100644 (file)
@@ -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;
index 4df91ceeeafe9fe8851cc5ffdf55c4e8ee59b655..c075e7b8d52b9c498a76a0a648abaee7cdc925e8 100644 (file)
@@ -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)
 {
index 77ae87f36e841296c13266910c34a1d9a79659de..90f65d9bbd04a5418189eddb4f2a365b033f946f 100644 (file)
@@ -140,6 +140,7 @@ int can_nice(const struct task_struct *p, const int nice)
 {
        return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 #ifdef __ARCH_WANT_SYS_NICE
 
index 20f27e2cf7aec691af040fcf2236a20374ec66bf..8b1338c283414e1dd14b65dca47dfc4021b9bedd 100644 (file)
@@ -231,6 +231,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* 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,
index 0f7519f8e7c93f9a4536c26a341255799c320432..45fd146b85df4eb8bb14db22ccb84ad6d158317e 100644 (file)
@@ -102,6 +102,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(task_work_add);
 
 /**
  * task_work_cancel_match - cancel a pending work added by task_work_add()
index ec48b5dadf519a5296ac14cda035c067f9e448f8..bf95d73c9815548a19db6345f856cee9baad22e3 100644 (file)
@@ -179,6 +179,7 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item, int nid,
        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)
 {
@@ -216,6 +217,7 @@ bool list_lru_del(struct list_lru *lru, struct list_head *item, int nid,
        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)
 {
index 75f3b66be1d38bb7b7c4721d21bf3a1f422e697f..d8ee36e78f047d86daf94526571cd60f45ef6fe6 100644 (file)
@@ -2042,6 +2042,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        zap_page_range_single_batched(&tlb, vma, address, size, details);
        tlb_finish_mmu(&tlb);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index b006cec8e6fe70dd40b320d486f781227d803875..b9c16662db6a16b936592801031103d15213565c 100644 (file)
@@ -267,6 +267,7 @@ fallback:
 
        return vma;
 }
+EXPORT_SYMBOL_GPL(lock_vma_under_rcu);
 #endif /* CONFIG_PER_VMA_LOCK */
 
 #ifdef CONFIG_LOCK_MM_AND_FIND_VMA
index ad163f06bf7abc4327f9918f11b903e1649ef35e..6d784386dec30df7754163482f1bbeaae034c8cf 100644 (file)
@@ -996,6 +996,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        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 struct cred *from,
 {
        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(const struct cred *from,
 {
        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 struct cred *from,
 {
        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