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, 1 Sep 2022 07:04:35 +0000 (08:04 +0100)
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/fork.c
kernel/sched/core.c
kernel/sched/wait.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index 3bcc1ecc314a78e90daedecf6a7ec575c642504a..6ff78a4c27a914253df67b0c3bf1ac7df6b87f0c 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -813,6 +813,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 9d44f2d46c6964d5cf7e29e06ad377b03fe25dc2..d587c85f35b1eec6373fc8f5176584597db23bea 100644 (file)
@@ -1225,6 +1225,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index d4af56927a4dabc54a58eb301fb6437c1eea31c7..b70c09a1774fd9a2dd0a2f606c5c1127df4416fa 100644 (file)
@@ -7026,6 +7026,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 9860bb9a847cf0572138cce9974545b004785558..ad76d49bf4e17fa3b43fe7a1f551de39d788045c 100644 (file)
@@ -243,6 +243,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 dff75bcde1514c82fc6580bcf407cd2ff7ae03cb..5f9a42a388f13756738d971fe714e41d457f27b4 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 1c6027adc5426b48f89e3e4e820e0c0144d5a579..75372d105b0e91ffecf296cca0d52edd97043ca2 100644 (file)
@@ -1749,6 +1749,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 f152375e770bfde2468daea5628f3a911bb2e9a5..ccc1633695febec35dea82058dedd993b8544514 100644 (file)
@@ -4173,6 +4173,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 188b8f7822206042dfbefb2764e611029a0b78a0..e5538a412f3c870b9a184f02e7e941fd5bebd389 100644 (file)
@@ -752,24 +752,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)
 {