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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
Index: linux-2.4.27-rsbac-v1.2.3/include/rsbac/aci_data_structures.h
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/include/rsbac/aci_data_structures.h (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/include/rsbac/aci_data_structures.h (working copy)
@@ -1134,7 +1134,7 @@
#endif
-#define RSBAC_USER_NR_ATTRIBUTES 28
+#define RSBAC_USER_NR_ATTRIBUTES 24
#define RSBAC_USER_ATTR_LIST { \
A_pseudo, \
A_log_user_based, \
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/help/syscalls.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/help/syscalls.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/help/syscalls.c (working copy)
@@ -1405,7 +1405,7 @@
int sys_rsbac_switch(enum rsbac_switch_target_t target, int value)
{
-#ifdef CONFIG_RSBAC_SWITCH
+#if defined(CONFIG_RSBAC_SWITCH) || defined(CONFIG_RSBAC_SOFTMODE)
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
char * switch_name;
@@ -1509,6 +1509,7 @@
case SOFTMODE: rsbac_softmode = value;
break;
#endif
+#ifdef CONFIG_RSBAC_SWITCH
#ifdef CONFIG_RSBAC_MAC
case MAC: rsbac_switch_mac = value;
break;
@@ -1557,6 +1558,7 @@
case RES: rsbac_switch_res = value;
break;
#endif
+#endif /* SWITCH */
default:
return (-RSBAC_EINVALIDMODULE);
}
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/adf/jail/jail_syscalls.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/adf/jail/jail_syscalls.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/adf/jail/jail_syscalls.c (working copy)
@@ -41,8 +41,10 @@
/* Externally visible functions */
/************************************************* */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
extern long sys_chroot(const char * filename);
extern long sys_chdir(const char * filename);
+#endif
/* Create a jail for current process */
/* Note: It is allowed to create jails within jails, but with restrictions */
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/adf/adf_main.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/adf/adf_main.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/adf/adf_main.c (working copy)
@@ -333,6 +333,14 @@
&& (sb_p->s_magic == PIPEFS_MAGIC)
)
return DO_NOT_CARE;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ /* No decision on pseudo sockfs */
+ if( (target == T_FILE)
+ && (!RSBAC_MAJOR(tid.file.device))
+ && (!RSBAC_MINOR(tid.file.device))
+ )
+ return DO_NOT_CARE;
+#endif
switch(request)
{
case R_GET_STATUS_DATA:
@@ -1008,6 +1016,7 @@
rsbac_pid_t parent_pid = 0;
/* Get owner's logging pseudo */
+ i_tid.user = owner;
if (rsbac_get_attr(GEN,T_USER,i_tid,A_pseudo,&i_attr_val,FALSE))
{
rsbac_ds_get_error("rsbac_adf_request()", A_pseudo);
@@ -2448,6 +2457,7 @@
#endif /* SECDEL */
#ifdef CONFIG_RSBAC_SYM_REDIR
+EXPORT_SYMBOL(rsbac_symlink_redirect);
void rsbac_symlink_redirect(struct dentry * dentry_p, char * name)
{
int err;
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/adf/adf_check.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/adf/adf_check.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/adf/adf_check.c (working copy)
@@ -439,6 +439,7 @@
{
case T_DIR:
case T_SCD:
+ case T_IPC:
#ifdef CONFIG_RSBAC_RW
case T_FILE:
case T_FIFO:
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/rc_data_structures.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/rc_data_structures.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/rc_data_structures.c (working copy)
@@ -146,7 +146,7 @@
off_t pos = 0;
off_t begin = 0;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "stats_rc_proc_info(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -1540,7 +1540,7 @@
int rsbac_stats_rc(void)
{
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_stats_rc(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/aci_data_structures.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/aci_data_structures.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/aci_data_structures.c (working copy)
@@ -9504,10 +9504,11 @@
/* All functions return 0, if no error occurred, and a negative error code */
/* otherwise. The error codes are defined in rsbac_error.h. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
/* declare sys_kill */
extern long sys_kill(int pid, int sig);
+#endif
-
#ifdef CONFIG_RSBAC_INIT_DELAY
int rsbac_init(kdev_t root_dev)
#else
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/pm_data_structures.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/pm_data_structures.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/pm_data_structures.c (working copy)
@@ -90,7 +90,7 @@
union rsbac_attribute_value_t rsbac_attribute_value;
#endif
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "stats_pm_proc_info(): RSBAC not initialized\n");
@@ -1661,7 +1661,7 @@
u_long all_member_count = 0;
u_long all_count = 0;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "rsbac_stats_pm(): RSBAC not initialized\n");
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/acl_data_structures.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/acl_data_structures.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/acl_data_structures.c (working copy)
@@ -539,7 +539,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "stats_acl_proc_info(): RSBAC not initialized\n");
@@ -759,7 +759,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "acl_acllist_proc_info(): RSBAC not initialized\n");
@@ -1697,7 +1697,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "acl_grouplist_proc_info(): RSBAC not initialized\n");
@@ -3057,7 +3057,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_stats_acl(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/mac_data_structures.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/mac_data_structures.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/mac_data_structures.c (working copy)
@@ -483,7 +483,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "stats_mac_proc_info(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -587,7 +587,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "mac_trulist_proc_info(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -1174,7 +1174,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "rsbac_stats_mac(): RSBAC not initialized\n");
@@ -1771,7 +1771,7 @@
struct rsbac_mac_device_list_item_t * device_p;
int err=0;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_mac_copy_fp_truset(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -1822,7 +1822,7 @@
int rsbac_mac_copy_pp_truset(rsbac_pid_t old_p_set_id,
rsbac_pid_t new_p_set_id)
{
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_mac_copy_pp_truset(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -1850,7 +1850,7 @@
struct rsbac_mac_device_list_item_t * device_p;
long count;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_mac_get_f_trulist(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -1904,7 +1904,7 @@
rsbac_uid_t **trulist_p,
rsbac_time_t **ttllist_p)
{
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_mac_get_p_trulist(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
Index: linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/auth_data_structures.c
===================================================================
--- linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/auth_data_structures.c (revision 16)
+++ linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/auth_data_structures.c (working copy)
@@ -770,7 +770,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "stats_auth_proc_info(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -940,7 +940,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "auth_caplist_proc_info(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -1908,7 +1908,7 @@
union rsbac_target_id_t rsbac_target_id;
union rsbac_attribute_value_t rsbac_attribute_value;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
#ifdef CONFIG_RSBAC_RMSG
rsbac_printk(KERN_WARNING "rsbac_stats_auth(): RSBAC not initialized\n");
@@ -2940,7 +2940,7 @@
struct rsbac_auth_device_list_item_t * device_p;
int err=0;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_auth_copy_fp_capset(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -2991,7 +2991,7 @@
int rsbac_auth_copy_pp_capset(rsbac_pid_t old_p_set_id,
rsbac_pid_t new_p_set_id)
{
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_auth_copy_pp_capset(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -3020,7 +3020,7 @@
struct rsbac_auth_device_list_item_t * device_p;
long count;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_auth_get_f_caplist(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
@@ -3098,7 +3098,7 @@
{
long count;
- if (!rsbac_is_initialized)
+ if (!rsbac_is_initialized())
{
printk(KERN_WARNING "rsbac_auth_get_p_caplist(): RSBAC not initialized\n");
return(-RSBAC_ENOTINITIALIZED);
|