Export symbols needed by Android drivers
authorBen Hutchings <ben@decadent.org.uk>
Tue, 26 Jun 2018 15:59:01 +0000 (16:59 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 7 Oct 2018 20:57:06 +0000 (21:57 +0100)
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
mm/memory.c
mm/shmem.c
mm/vmalloc.c
security/security.c

index 7ffd6e9d103d6470cbc2ea0b1618ea2f2cb028c2..11d9fa19bb814fb74804162a10a393c12bc7c7bc 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)
 {
@@ -533,6 +535,7 @@ out:
        spin_unlock(&files->file_lock);
        return error;
 }
+EXPORT_SYMBOL_GPL(__alloc_fd);
 
 static int alloc_fd(unsigned start, unsigned flags)
 {
@@ -606,6 +609,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)
 {
index 8ed48ca2cc4377b9b83e8b49201c296ab04ef660..e96dbf077b979aa87f31c85a2013a86ab537e3e0 100644 (file)
@@ -1030,6 +1030,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index 5ba96d9ddbde5f4e06def3bcf392795b9432e9cb..bc1d9315dc75fb65bbc962013d4c8e8965a6b486 100644 (file)
@@ -3959,6 +3959,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 8d8a940422a8e0d7758a46fecff34b26782e1787..867dc453d8b70886339ccce0232a98b4ebfa2962 100644 (file)
@@ -1270,6 +1270,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 f94feec6518d98629acd113aab45864fe2d36a00..d38409b83403aff943c044322627b2461b016228 100644 (file)
@@ -1627,6 +1627,7 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long start,
        mmu_notifier_invalidate_range_end(mm, start, end);
        tlb_finish_mmu(&tlb, start, end);
 }
+EXPORT_SYMBOL_GPL(zap_page_range);
 
 /**
  * zap_page_range_single - remove user pages in a given range
index 41b9bbf24e16b49db1da4be286fe7310941ad542..0ef9f652a39f000ebb0f09e8e4cad39b34ed5558 100644 (file)
@@ -4030,6 +4030,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 cfea25be77548cfad6ffc5d4c4d3f60445804f52..99fa8a3dbafcfc4b084267f10871f4f04ba2e7ca 100644 (file)
@@ -1295,6 +1295,7 @@ int map_kernel_range_noflush(unsigned long addr, unsigned long size,
 {
        return vmap_page_range_noflush(addr, addr + size, prot, pages);
 }
+EXPORT_SYMBOL_GPL(map_kernel_range_noflush);
 
 /**
  * unmap_kernel_range_noflush - unmap kernel VM area
@@ -1435,6 +1436,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 4e572b38937d8923ea3ec06eff7a6cab7420bc1e..180498802f7152e85d8196b4b6c98460d58cec3a 100644 (file)
@@ -233,24 +233,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)
 {