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>
Sat, 17 Oct 2020 13:14:43 +0000 (14:14 +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/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index 21c0893f2f1df8f2feda08913cdeceeaed7a0b89..51e118169107930e1d814bc262e01591f7c85640 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 da8d360fb0326e18a059313c8b21fe93220b5eb5..a6ee28a8d7199461c04187d41f3fad4a8dc03b6e 100644 (file)
@@ -1115,6 +1115,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index 2d95dc3f46444ece3e21feee786be746c131b512..8f822e49ccaa949a1a14f97e96d34d484527abe0 100644 (file)
@@ -5017,6 +5017,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 613b2d634af82fb6c3d4505df7159c9396e10e89..d621006f007c62489cf3ab662e6550c2d7237247 100644 (file)
@@ -58,6 +58,7 @@ task_work_add(struct task_struct *task, struct callback_head *work, int notify)
 
        return 0;
 }
+EXPORT_SYMBOL(task_work_add);
 
 /**
  * task_work_cancel - cancel a pending work added by task_work_add()
index eeae590e526aa845c83a793cfc658f2f90e60ec6..0117ec3d962ebb77f52515459edf1a558753bc5b 100644 (file)
@@ -1527,6 +1527,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 8e2b35ba93ad173e74b21c38fe3002cf8aceee6c..da817e7e030749277a7f34e52c123ba6c80ec2a2 100644 (file)
@@ -4278,6 +4278,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 70a7ad357bc6ab35aa4c7b6f7616222a8b88c805..6e2ad1fa598a099e67037064c4b5f70ec176db99 100644 (file)
@@ -725,24 +725,28 @@ int security_binder_set_context_mgr(struct task_struct *mgr)
 {
        return call_int_hook(binder_set_context_mgr, 0, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 int security_binder_transaction(struct task_struct *from,
                                struct task_struct *to)
 {
        return call_int_hook(binder_transaction, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 int security_binder_transfer_binder(struct task_struct *from,
                                    struct task_struct *to)
 {
        return call_int_hook(binder_transfer_binder, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 int security_binder_transfer_file(struct task_struct *from,
                                  struct task_struct *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)
 {