Export symbols needed by Android drivers
authorBen Hutchings <ben@decadent.org.uk>
Tue, 26 Jun 2018 15:59:01 +0000 (16:59 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 5 Sep 2020 14:52:44 +0000 (15:52 +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/signal.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
mm/vmalloc.c
security/security.c

index abb8b7081d7a44e1f82cd1c862d25dfb63c8bb40..2f664a1753733d8ebebe352a62ec7c2294a2cc5b 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -409,6 +409,7 @@ struct files_struct *get_files_struct(struct task_struct *task)
 
        return files;
 }
+EXPORT_SYMBOL_GPL(get_files_struct);
 
 void put_files_struct(struct files_struct *files)
 {
@@ -421,6 +422,7 @@ void put_files_struct(struct files_struct *files)
                kmem_cache_free(files_cachep, files);
        }
 }
+EXPORT_SYMBOL_GPL(put_files_struct);
 
 void reset_files_struct(struct files_struct *files)
 {
@@ -534,6 +536,7 @@ out:
        spin_unlock(&files->file_lock);
        return error;
 }
+EXPORT_SYMBOL_GPL(__alloc_fd);
 
 static int alloc_fd(unsigned start, unsigned flags)
 {
@@ -612,6 +615,7 @@ void __fd_install(struct files_struct *files, unsigned int fd,
        rcu_assign_pointer(fdt->fd[fd], file);
        rcu_read_unlock_sched();
 }
+EXPORT_SYMBOL_GPL(__fd_install);
 
 void fd_install(unsigned int fd, struct file *file)
 {
@@ -676,6 +680,7 @@ out_unlock:
        *res = NULL;
        return -ENOENT;
 }
+EXPORT_SYMBOL(__close_fd_get_file);
 
 void do_close_on_exec(struct files_struct *files)
 {
index efc5493203ae0b744d0684ec10f531bb5c7b9557..7d5e390b4be393fe1470950564dec98b18a817fd 100644 (file)
@@ -1131,6 +1131,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index f788cd61df21298ba264760df844fdcd9255cdfa..ede9475ba29af81aa147a9a9efb222f67c304010 100644 (file)
@@ -4797,6 +4797,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 42b67d2cea370af1eb6b40ee76d7ff5cc094e93a..842a0303aa4c3b6f1d0280ee46dec83f6b63f797 100644 (file)
@@ -1396,6 +1396,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
 
        return sighand;
 }
+EXPORT_SYMBOL_GPL(__lock_task_sighand);
 
 /*
  * send signal info to all the members of a group
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 a279c1a26af7e1f3af3fb1149e1d4a7d1b443abd..bf4a0e84aeb6f25c884a5fc940445dc3173150a9 100644 (file)
@@ -1367,6 +1367,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 b2abca3f7f33f2996f84eed7db0d52e7d7ed81f9..cc9a66808b2e55bb51413f429495969d922cbee8 100644 (file)
@@ -4158,6 +4158,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 128d20d2d6cb670b4b07be60cb661d7b9fbd99f1..a3e656894d30cd48f5e53de9d339786b079c1c87 100644 (file)
@@ -1280,6 +1280,7 @@ overflow:
        kmem_cache_free(vmap_area_cachep, va);
        return ERR_PTR(-EBUSY);
 }
+EXPORT_SYMBOL_GPL(map_kernel_range_noflush);
 
 int register_vmap_purge_notifier(struct notifier_block *nb)
 {
@@ -2149,6 +2150,7 @@ struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
                                  NUMA_NO_NODE, GFP_KERNEL,
                                  __builtin_return_address(0));
 }
+EXPORT_SYMBOL_GPL(get_vm_area);
 
 struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
                                const void *caller)
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)
 {