Export symbols needed by Android drivers
authorBen Hutchings <ben@decadent.org.uk>
Mon, 7 Sep 2020 01:51:53 +0000 (02:51 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 22 May 2025 18:32:07 +0000 (20:32 +0200)
Bug-Debian: https://bugs.debian.org/901492

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.

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

fs/file.c
kernel/sched/core.c
kernel/sched/wait.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index 2eccbb5dcd86a6f159375c30761fc2775045bb2b..95cfe6463dbbb3d5732aa2dc60204fa445cf3607 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -792,6 +792,7 @@ struct file *close_fd_get_file(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index 9b01fdceb62200e9b68e5bbb8efd80b5d2ff2f7d..03f5d45a01067b4f27cc0bc6820a554ba8144eb6 100644 (file)
@@ -7119,6 +7119,7 @@ static bool is_nice_reduction(const struct task_struct *p, const int nice)
 
        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 /*
  * can_nice - check if a task can reduce its nice value
index 133b74730738bef2c412d6b270fddb3944b4b22c..a2a3381ede737c9693c7286e2f36a83d2e1f41bf 100644 (file)
@@ -247,6 +247,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 ffba54734cdb42acdfc5be83075c2063a887b41d..9e5c04df376118917cccd8b63d87a22ac52cb387 100644 (file)
@@ -73,6 +73,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 454d918449b3ae40cad08e2f94510a338b2faf22..f325eeaf0fd72e73324824469155ec4f9dfb8010 100644 (file)
@@ -1761,6 +1761,7 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long start,
        mmu_notifier_invalidate_range_end(&range);
        tlb_finish_mmu(&tlb);
 }
+EXPORT_SYMBOL_GPL(zap_page_range);
 
 /**
  * zap_page_range_single - remove user pages in a given range
index 2e6b7db7f14bdeb0b85fb12fb285f5a1f473e5e5..12e6a61c983acf5ac070bda681471d192ea2ab0e 100644 (file)
@@ -4324,6 +4324,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(shmem_zero_setup);
 
 /**
  * shmem_read_mapping_page_gfp - read into page cache, using specified page allocation flags.
index fb1692254851b213f01d2bd7a440fa7ab8c40030..d1c749cb672732f9d118c68b33dc579f38d8625c 100644 (file)
@@ -754,24 +754,28 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, 0, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 int security_binder_transaction(const struct cred *from,
                                const struct cred *to)
 {
        return call_int_hook(binder_transaction, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 int security_binder_transfer_binder(const struct cred *from,
                                    const struct cred *to)
 {
        return call_int_hook(binder_transfer_binder, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 int security_binder_transfer_file(const struct cred *from,
                                  const struct cred *to, struct file *file)
 {
        return call_int_hook(binder_transfer_file, 0, from, to, file);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
 
 int security_ptrace_access_check(struct task_struct *child, unsigned int mode)
 {