1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 07 Sep 2020 02:51:53 +0100
Subject: 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.
---
fs/file.c | 1 +
kernel/sched/core.c | 1 +
kernel/sched/wait.c | 1 +
kernel/task_work.c | 1 +
mm/memory.c | 1 +
mm/shmem.c | 1 +
security/security.c | 4 ++++
7 files changed, 10 insertions(+)
--- a/fs/file.c
+++ b/fs/file.c
@@ -813,6 +813,7 @@ struct file *close_fd_get_file(unsigned
return file;
}
+EXPORT_SYMBOL_GPL(close_fd_get_file);
void do_close_on_exec(struct files_struct *files)
{
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7052,6 +7052,7 @@ static bool is_nice_reduction(const stru
return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
}
+EXPORT_SYMBOL_GPL(can_nice);
/*
* can_nice - check if a task can reduce its nice value
--- a/kernel/sched/wait.c
+++ b/kernel/sched/wait.c
@@ -243,6 +243,7 @@ void __wake_up_pollfree(struct wait_queu
/* 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,
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -73,6 +73,7 @@ int task_work_add(struct task_struct *ta
return 0;
}
+EXPORT_SYMBOL_GPL(task_work_add);
/**
* task_work_cancel_match - cancel a pending work added by task_work_add()
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1757,6 +1757,7 @@ void zap_page_range(struct vm_area_struc
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
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4245,6 +4245,7 @@ int shmem_zero_setup(struct vm_area_stru
return 0;
}
+EXPORT_SYMBOL_GPL(shmem_zero_setup);
/**
* shmem_read_mapping_page_gfp - read into page cache, using specified page allocation flags.
--- a/security/security.c
+++ b/security/security.c
@@ -752,24 +752,28 @@ int security_binder_set_context_mgr(cons
{
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)
{
|