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, 10 Aug 2022 18:11:48 +0000 (19:11 +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/sched/wait.c
kernel/task_work.c
mm/memory.c
mm/shmem.c
security/security.c

index ee931734670257393aa9ee1383596e233c69d05b..9885f25f5340c40deae7de142e2b984e6b1b2047 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -833,6 +833,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 0d8abfb9e0f4a5f29f9db4787f99b7b52758cc80..617e71efeb930dd4e3f986f390b8596c0f622786 100644 (file)
@@ -1222,6 +1222,7 @@ void mmput_async(struct mm_struct *mm)
                schedule_work(&mm->async_put_work);
        }
 }
+EXPORT_SYMBOL_GPL(mmput_async);
 #endif
 
 /**
index dd11daa7a84b1b7b21251e4f8b788ceb80b11634..6f3151a897b68408c42e59c95946de84511b72b8 100644 (file)
@@ -6970,6 +6970,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 9860bb9a847cf0572138cce9974545b004785558..ad76d49bf4e17fa3b43fe7a1f551de39d788045c 100644 (file)
@@ -243,6 +243,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* POLLFREE must have cleared the queue. */
        WARN_ON_ONCE(waitqueue_active(wq_head));
 }
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
 
 /*
  * Note: we use "set_current_state()" _after_ the wait-queue add,
index c59e1a49bc406c7a2cb0e05a36053dd3ad13a9ba..d92b8726b1d4882794ab2cfd32c46af9a5c41403 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 4ef55c26e114e6e5a970b535a75ce8fbb0d77552..c87362dd62ee7675fe529adb44bfc36e5abf694a 100644 (file)
@@ -1671,6 +1671,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 4b2fea33158e8a33a87354ccefc574ef74c1e793..0fcd0cfea35df3fb6743894167db121dc03ff1c2 100644 (file)
@@ -4153,6 +4153,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 aaf6566deb9f0e8153ab777c56b790e561d7806a..f32e312ef6fcb00ddd0910a03ce0c8e7ecb673b0 100644 (file)
@@ -753,24 +753,28 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, 0, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 int security_binder_transaction(const struct cred *from,
                                const struct cred *to)
 {
        return call_int_hook(binder_transaction, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 int security_binder_transfer_binder(const struct cred *from,
                                    const struct cred *to)
 {
        return call_int_hook(binder_transfer_binder, 0, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 int security_binder_transfer_file(const struct cred *from,
                                  const struct cred *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)
 {