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, 18 Apr 2022 12:36:36 +0000 (13:36 +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 ee931734670257393aa9ee1383596e233c69d05b..9885f25f5340c40deae7de142e2b984e6b1b2047 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -833,6 +833,7 @@ int close_fd_get_file(unsigned int fd, struct file **res)
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index f1e89007f22889c627aadb53934b27cd66b29afe..c5cb85ea53e473c501243a68634a45de875e46d6 100644 (file)
@@ -1152,6 +1152,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index 1eec4925b8c644a58846605d3333c1326ea2c30b..a8573bc1eb8d8e31d1013e70a0eab120d1af32cc 100644 (file)
@@ -6970,6 +6970,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 eca38107b32f162adad278aee6e522bdfe04c026..2e645b076916c08275b4653269beba732d14a774 100644 (file)
@@ -244,6 +244,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 1698fbe6f0e134ac2a2ab3e9357b44af99c71f83..2a1644189182f978c74845c82d574389cc588118 100644 (file)
@@ -60,6 +60,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 b69afe3dd597a3e0ef269c1d0e4b3eda5f38ac48..4575af1944aaeeaac92aaeea049cb5c53ba8cc58 100644 (file)
@@ -1686,6 +1686,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 a09b29ec2b45c906fef4e8fcfc0d88a93ea99718..98f73f109f196a36f2b017e226f8d24ae011a137 100644 (file)
@@ -4140,6 +4140,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 b7cf5cbfdc677a37017e1e493f76d5644365bbf0..18f508bf3ea3d29aedcb58af259e6c59bc3408d7 100644 (file)
@@ -751,24 +751,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)
 {