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>
Wed, 20 Jan 2021 16:40:43 +0000 (16:40 +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/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index 4559b5fec3bd53e8d22f79ddfa2a065cd3d527bb..af2c7e3169f4db742081ea8cef965d832b331957 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -782,6 +782,7 @@ out_unlock:
        *res = NULL;
        return -ENOENT;
 }
+EXPORT_SYMBOL(__close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index c675fdbd3dce1377480c4a70a496e5d1680d88ea..3327d5c7c57af7e7792a01d8c1fa193dd78f342e 100644 (file)
@@ -1118,6 +1118,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index 77aa0e788b9b76b9cd13ac3a0bda6fa9e9b0a1b2..98ae3174e68b53a67f31401f9588d6cf7bd74cd4 100644 (file)
@@ -5022,6 +5022,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 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 50632c4366b8ab5d66dfd162847bf7ecfc9c6d97..82a13bc39718a35febd3bea0544f2e676b878660 100644 (file)
@@ -1542,6 +1542,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 537c137698f8a93bbde2d6876e0aa94221278bd5..387f58694911d568843d5dd880ae154b8febbbcf 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 a28045dc9e7f62b1fe843189b14e7d2f7620c355..5e35ba58540a09fb1c965156a17b972c579a1652 100644 (file)
@@ -726,24 +726,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)
 {