Export symbols needed by binder
authorBen Hutchings <ben@decadent.org.uk>
Mon, 5 Aug 2024 01:26:48 +0000 (03:26 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Wed, 16 Jul 2025 07:13:16 +0000 (09:13 +0200)
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-android-drivers.patch

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

index b6fb6d18ac3b9b05464ee961ac9705a921d08938..2f5fce87c8f2c3d1799d9594e44dfb764aefbff2 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -801,6 +801,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 f9cb7896c1b96685151e314892ca43e6e6596a4b..48aea43905abb34105c53841a3fdeff481bb838e 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 51e38f5f47018c953e31c834dc6385c182359359..8b3547706b00a8e07363253f61f6d08e83ff966e 100644 (file)
@@ -212,6 +212,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 c969f1f26be58a87babfb7f05464e612bec1bc98..b25732eae3882a27b2045bf0154fd1395ff07ffa 100644 (file)
@@ -108,6 +108,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 b6daa0e673a54958b9c95f29d63371ae2bdea02c..24b18f04a17c36e399d2f7c4ccf085609090b8f4 100644 (file)
@@ -1934,6 +1934,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        tlb_finish_mmu(&tlb);
        hugetlb_zap_end(vma, details);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index c5981e558bc2643b485778edf5c5c20f725ccb00..cb999f0f8094e6d5e1a6e6b3eed8c69d5b55e8a1 100644 (file)
@@ -997,6 +997,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
@@ -1012,6 +1013,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
@@ -1027,6 +1029,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
@@ -1043,6 +1046,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