-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathandroid-enable-building-binder-as-module.patch
More file actions
182 lines (158 loc) · 5.72 KB
/
android-enable-building-binder-as-module.patch
File metadata and controls
182 lines (158 loc) · 5.72 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
--- a/drivers/android/Kconfig~ 2025-11-30 23:42:10.000000000 +0100
+++ b/drivers/android/Kconfig 2025-12-03 18:43:47.909352635 +0100
@@ -2,7 +2,7 @@
menu "Android"
config ANDROID_BINDER_IPC
- bool "Android Binder IPC Driver"
+ tristate "Android Binder IPC Driver"
depends on MMU
depends on NET
default n
--- a/drivers/android/Makefile~ 2025-11-30 23:42:10.000000000 +0100
+++ b/drivers/android/Makefile 2025-12-03 18:48:33.118536606 +0100
@@ -1,7 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y += -I$(src) # needed for trace events
-obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
-obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o binder_netlink.o
-obj-$(CONFIG_ANDROID_BINDER_ALLOC_KUNIT_TEST) += tests/
-obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) += binder/
+obj-$(CONFIG_ANDROID_BINDER_IPC) += binder_linux.o
+binder_linux-y := binder.o binder_alloc.o binder_netlink.o
+binder_linux-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
+binder_linux-$(CONFIG_ANDROID_BINDER_ALLOC_KUNIT_TEST) += tests/
+binder_linux-$(CONFIG_ANDROID_BINDER_IPC_RUST) += binder/
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -38,7 +38,7 @@ enum {
};
static uint32_t binder_alloc_debug_mask = BINDER_DEBUG_USER_ERROR;
-module_param_named(debug_mask, binder_alloc_debug_mask,
+module_param_named(alloc_debug_mask, binder_alloc_debug_mask,
uint, 0644);
#define binder_alloc_debug(mask, x...) \
--- a/fs/file.c
+++ b/fs/file.c
@@ -813,6 +813,7 @@ struct file *file_close_fd(unsigned
return file;
}
+EXPORT_SYMBOL_GPL(file_close_fd);
void do_close_on_exec(struct files_struct *files)
{
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.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/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/security/security.c
+++ b/security/security.c
@@ -798,6 +798,7 @@ int security_binder_set_context_mgr(cons
{
return call_int_hook(binder_set_context_mgr, mgr);
}
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
/**
* security_binder_transaction() - Check if a binder transaction is allowed
@@ -813,6 +814,7 @@ int security_binder_transaction(const st
{
return call_int_hook(binder_transaction, from, to);
}
+EXPORT_SYMBOL_GPL(security_binder_transaction);
/**
* security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -828,6 +830,7 @@ int security_binder_transfer_binder(cons
{
return call_int_hook(binder_transfer_binder, from, to);
}
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
/**
* security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -844,6 +847,7 @@ int security_binder_transfer_file(const
{
return call_int_hook(binder_transfer_file, from, to, file);
}
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
/**
* security_ptrace_access_check() - Check if tracing is allowed
--- a/ipc/namespace.c~ 2025-11-30 23:42:10.000000000 +0100
+++ b8/ipc/namespace.c 2025-12-03 18:49:49.032978968 +0100
@@ -208,6 +208,7 @@ void put_ipc_ns(struct ipc_namespace *ns
schedule_work(&free_ipc_work);
}
}
+EXPORT_SYMBOL_GPL(put_ipc_ns);
static struct ns_common *ipcns_get(struct task_struct *task)
{
--- a/kernel/sched/wait.c~ 2022-12-11 23:15:18.000000000 +0100
+++ b/kernel/sched/wait.c 2022-12-29 16:11:51.746470281 +0100
@@ -243,6 +243,7 @@
/* 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/ipc/msgutil.c~ 2025-11-30 23:42:10.000000000 +0100
+++ b/ipc/msgutil.c 2025-12-03 18:50:45.802371237 +0100
@@ -30,6 +30,7 @@ struct ipc_namespace init_ipc_ns = {
.ns = NS_COMMON_INIT(init_ipc_ns),
.user_ns = &init_user_ns,
};
+EXPORT_SYMBOL_GPL(init_ipc_ns);
struct msg_msgseg {
struct msg_msgseg *next;
--- linux-6.3/mm/memory.c.orig 2023-04-23 21:02:52.000000000 +0200
+++ linux-6.3/mm/memory.c 2023-04-26 10:57:23.873394940 +0200
@@ -2050,6 +2050,7 @@ void zap_page_range_single(struct vm_are
zap_page_range_single_batched(&tlb, vma, address, size, details);
tlb_finish_mmu(&tlb);
}
+EXPORT_SYMBOL_GPL(zap_page_range_single);
/**
* zap_vma_ptes - remove ptes mapping the vma
--- linux-6.14/mm/list_lru.c.orig 2025-03-24 15:02:41.000000000 +0100
+++ linux-6.14/mm/list_lru.c 2025-04-04 15:00:26.574714908 +0200
@@ -175,6 +175,7 @@
unlock_list_lru(l, false);
return false;
}
+EXPORT_SYMBOL_GPL(list_lru_add);
bool list_lru_add_obj(struct list_lru *lru, struct list_head *item)
{
@@ -212,6 +213,7 @@
unlock_list_lru(l, false);
return false;
}
+EXPORT_SYMBOL_GPL(list_lru_del);
bool list_lru_del_obj(struct list_lru *lru, struct list_head *item)
{
--- linux-6.16/mm/mmap_lock.c~ 2025-07-27 23:26:38.000000000 +0200
+++ linux-6.16/mm/mmap_lock.c 2025-07-31 17:46:12.853651399 +0200
@@ -178,6 +178,7 @@ inval:
count_vm_vma_lock_event(VMA_LOCK_ABORT);
return NULL;
}
+EXPORT_SYMBOL_GPL(lock_vma_under_rcu);
static struct vm_area_struct *lock_next_vma_under_mmap_lock(struct mm_struct *mm,
struct vma_iterator *vmi,
--- a/drivers/android/binder.c~ 2025-11-30 23:42:10.000000000 +0100
+++ b/drivers/android/binder.c 2025-12-03 19:11:49.969621371 +0100
@@ -78,6 +78,9 @@
#include "binder_internal.h"
#include "binder_trace.h"
+MODULE_DESCRIPTION("Android Binder");
+MODULE_LICENSE("GPL");
+
static HLIST_HEAD(binder_deferred_list);
static DEFINE_MUTEX(binder_deferred_lock);