From: Ben Hutchings Date: Mon, 7 Sep 2020 01:51:53 +0000 (+0100) Subject: Export symbols needed by Android drivers X-Git-Tag: archive/raspbian/5.10.84-1+rpi1^2~77 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7a7bd88f1b7276ee9f147e62da2271e2465ad303;p=linux.git Export symbols needed by Android drivers 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 --- diff --git a/fs/file.c b/fs/file.c index 9d02352fa18..add386da324 100644 --- a/fs/file.c +++ b/fs/file.c @@ -780,6 +780,7 @@ out_unlock: *res = NULL; return -ENOENT; } +EXPORT_SYMBOL(__close_fd_get_file); void do_close_on_exec(struct files_struct *files) { diff --git a/kernel/fork.c b/kernel/fork.c index e465903abed..6a3e9290c09 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1127,6 +1127,7 @@ void mmput_async(struct mm_struct *mm) schedule_work(&mm->async_put_work); } } +EXPORT_SYMBOL_GPL(mmput_async); #endif /** diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 0a5f9fad45e..430ac59cd0d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5043,6 +5043,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 diff --git a/kernel/task_work.c b/kernel/task_work.c index 8d6e1217c45..7cf8f9a6b64 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -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() diff --git a/mm/memory.c b/mm/memory.c index 4fe24cd865a..143bc50d349 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1554,6 +1554,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 diff --git a/mm/shmem.c b/mm/shmem.c index ae8adca3b56..45bc9dcba83 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -4283,6 +4283,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. diff --git a/security/security.c b/security/security.c index a864ff824dd..5ae0ca978fe 100644 --- a/security/security.c +++ b/security/security.c @@ -727,24 +727,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) {