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, 3 Nov 2021 14:35:31 +0000 (14:35 +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 86dc9956af32cc7c58a7fef7ca31b6fb316610b7..67ebea521792278d5b363441bc8bbeddbca4a48e 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -788,6 +788,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 cbba21e3a58dff70e1f4e66bfe50ea18d0a00185..aefedf577de802ec1aad7d03980bde7eea621a9f 100644 (file)
@@ -1140,6 +1140,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index e165d28cf73be21fa2687dd18dd72b30f46b4490..e5608a77d79cfb5327ff3f870c0b3acd5bfd0c5a 100644 (file)
@@ -6671,6 +6671,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 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 738f4e1df81ee7f5cc4eb7b017980404f0985898..3ce8cdeebe316404287e05113a017359073439d4 100644 (file)
@@ -1655,6 +1655,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 dacda7463d549de8d489b26b84418ea9869f6654..5525d5abb1159c0299b17b72bc8f27e56fe0df88 100644 (file)
@@ -4187,6 +4187,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 9ffa9e9c5c554a6939cf175560a617414ce38a00..4dfd046c9b86fc179b6b70c52384ecb231d2c522 100644 (file)
@@ -751,24 +751,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)
 {