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>
Mon, 7 Mar 2022 21:06:21 +0000 (21:06 +0000)
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 79a76d04c7c337cde54001ab5bef231a52240a63..ff757f254f31aae4bdaac4d1c60a0fc6fbd1a610 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -780,6 +780,7 @@ out_unlock:
        *res = NULL;
        return -ENOENT;
 }
+EXPORT_SYMBOL(__close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index a78c0b02edd55658f5e67c7c43a3559614823740..b877480c901f0b07bcf48d715d0c15f546b53bc6 100644 (file)
@@ -1127,6 +1127,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index 0a5f9fad45e4b5d815da077f75c389c66b70d8b0..430ac59cd0d20cab5b24a5f5756a76b4b33ebf5d 100644 (file)
@@ -5043,6 +5043,7 @@ int can_nice(const struct task_struct *p, const int nice)
        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
                capable(CAP_SYS_NICE));
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 #ifdef __ARCH_WANT_SYS_NICE
 
index a55642aa3f68b98940140fca6610cbd6694bd754..0674c60a77d8840aa48f178b43a3f78436195df1 100644 (file)
@@ -229,6 +229,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 8d6e1217c451c003cb4659d16a0a09aba886f1f4..7cf8f9a6b64823b6b96d371a802eec228bf1b4d4 100644 (file)
@@ -68,6 +68,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL(task_work_add);
 
 /**
  * task_work_cancel - cancel a pending work added by task_work_add()
index 4fe24cd865a79917b3f3eaf6814d133c39fa83e4..143bc50d349a2923486f75ff49a67898ba677d45 100644 (file)
@@ -1554,6 +1554,7 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long start,
        mmu_notifier_invalidate_range_end(&range);
        tlb_finish_mmu(&tlb, start, range.end);
 }
+EXPORT_SYMBOL_GPL(zap_page_range);
 
 /**
  * zap_page_range_single - remove user pages in a given range
index d3d8c5e7a296bfb74d65127052ddc020e6575c9f..5ab1ab984e569a946e5abdf7e74e57ed4ddd74a8 100644 (file)
@@ -4288,6 +4288,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 a864ff824dd3bb6a334385b698b2f4bf3f477d62..5ae0ca978fe295f127925cec1bb7bf8845e9c104 100644 (file)
@@ -727,24 +727,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)
 {