1 diff -urN -X dontdiff linux-2.6.0-test6-mm2.orig/security/selinux/include/security.h linux-2.6.0-test6-mm2.w1/security/selinux/include/security.h
2 --- linux-2.6.0-test6-mm2.orig/security/selinux/include/security.h 2003-09-27 20:50:07.000000000 -0400
3 +++ linux-2.6.0-test6-mm2.w1/security/selinux/include/security.h 2003-10-03 15:06:59.901346808 -0400
5 #define SECCLASS_NULL 0x0000 /* no class */
7 #define SELINUX_MAGIC 0xf97cff8c
8 +#define POLICYDB_VERSION 15
10 #ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
11 extern int selinux_enabled;
12 diff -urN -X dontdiff linux-2.6.0-test6-mm2.orig/security/selinux/selinuxfs.c linux-2.6.0-test6-mm2.w1/security/selinux/selinuxfs.c
13 --- linux-2.6.0-test6-mm2.orig/security/selinux/selinuxfs.c 2003-09-27 20:51:22.000000000 -0400
14 +++ linux-2.6.0-test6-mm2.w1/security/selinux/selinuxfs.c 2003-10-03 15:04:31.579895096 -0400
16 SEL_ACCESS, /* compute access decision */
17 SEL_CREATE, /* compute create labeling decision */
18 SEL_RELABEL, /* compute relabeling decision */
19 - SEL_USER /* compute reachable user contexts */
20 + SEL_USER, /* compute reachable user contexts */
21 + SEL_POLICYVERS /* return policy version for this kernel */
24 static ssize_t sel_read_enforce(struct file *filp, char *buf,
26 .write = sel_write_enforce,
29 +static ssize_t sel_read_policyvers(struct file *filp, char *buf,
30 + size_t count, loff_t *ppos)
36 + if (count < 0 || count > PAGE_SIZE)
38 + if (!(page = (char*)__get_free_page(GFP_KERNEL)))
40 + memset(page, 0, PAGE_SIZE);
42 + length = snprintf(page, PAGE_SIZE, "%u", POLICYDB_VERSION);
44 + free_page((unsigned long)page);
48 + if (*ppos >= length) {
49 + free_page((unsigned long)page);
52 + if (count + *ppos > length)
53 + count = length - *ppos;
54 + end = count + *ppos;
55 + if (copy_to_user(buf, (char *) page + *ppos, count)) {
61 + free_page((unsigned long)page);
65 +static struct file_operations sel_policyvers_ops = {
66 + .read = sel_read_policyvers,
69 static ssize_t sel_write_load(struct file * file, const char * buf,
70 size_t count, loff_t *ppos)
73 [SEL_CREATE] = {"create", &transaction_ops, S_IRUGO|S_IWUGO},
74 [SEL_RELABEL] = {"relabel", &transaction_ops, S_IRUGO|S_IWUGO},
75 [SEL_USER] = {"user", &transaction_ops, S_IRUGO|S_IWUGO},
76 + [SEL_POLICYVERS] = {"policyvers", &sel_policyvers_ops, S_IRUGO},
79 return simple_fill_super(sb, SELINUX_MAGIC, selinux_files);
80 diff -urN -X dontdiff linux-2.6.0-test6-mm2.orig/security/selinux/ss/policydb.h linux-2.6.0-test6-mm2.w1/security/selinux/ss/policydb.h
81 --- linux-2.6.0-test6-mm2.orig/security/selinux/ss/policydb.h 2003-09-27 20:50:38.000000000 -0400
82 +++ linux-2.6.0-test6-mm2.w1/security/selinux/ss/policydb.h 2003-10-03 15:06:59.291439528 -0400
85 #define PERM_SYMTAB_SIZE 32
87 -#define POLICYDB_VERSION 15
88 #define POLICYDB_CONFIG_MLS 1
90 #define OBJECT_R "object_r"