git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: emaclite: Use resource_size
[safe/jmp/linux-2.6]
/
security
/
selinux
/
selinuxfs.c
diff --git
a/security/selinux/selinuxfs.c
b/security/selinux/selinuxfs.c
index
8d4007f
..
cd191bb
100644
(file)
--- a/
security/selinux/selinuxfs.c
+++ b/
security/selinux/selinuxfs.c
@@
-282,7
+282,8
@@
static ssize_t sel_read_mls(struct file *filp, char __user *buf,
char tmpbuf[TMPBUFLEN];
ssize_t length;
char tmpbuf[TMPBUFLEN];
ssize_t length;
- length = scnprintf(tmpbuf, TMPBUFLEN, "%d", selinux_mls_enabled);
+ length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
+ security_mls_enabled());
return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
}
return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
}
@@
-494,7
+495,6
@@
static ssize_t sel_write_access(struct file *file, char *buf, size_t size)
char *scon, *tcon;
u32 ssid, tsid;
u16 tclass;
char *scon, *tcon;
u32 ssid, tsid;
u16 tclass;
- u32 req;
struct av_decision avd;
ssize_t length;
struct av_decision avd;
ssize_t length;
@@
-512,7
+512,7
@@
static ssize_t sel_write_access(struct file *file, char *buf, size_t size)
goto out;
length = -EINVAL;
goto out;
length = -EINVAL;
- if (sscanf(buf, "%s %s %hu
%x", scon, tcon, &tclass, &req) != 4
)
+ if (sscanf(buf, "%s %s %hu
", scon, tcon, &tclass) != 3
)
goto out2;
length = security_context_to_sid(scon, strlen(scon)+1, &ssid);
goto out2;
length = security_context_to_sid(scon, strlen(scon)+1, &ssid);
@@
-522,9
+522,7
@@
static ssize_t sel_write_access(struct file *file, char *buf, size_t size)
if (length < 0)
goto out2;
if (length < 0)
goto out2;
- length = security_compute_av(ssid, tsid, tclass, req, &avd);
- if (length < 0)
- goto out2;
+ security_compute_av_user(ssid, tsid, tclass, &avd);
length = scnprintf(buf, SIMPLE_TRANSACTION_LIMIT,
"%x %x %x %x %u %x",
length = scnprintf(buf, SIMPLE_TRANSACTION_LIMIT,
"%x %x %x %x %u %x",
@@
-571,7
+569,7
@@
static ssize_t sel_write_create(struct file *file, char *buf, size_t size)
if (length < 0)
goto out2;
if (length < 0)
goto out2;
- length = security_transition_sid(ssid, tsid, tclass, &newsid);
+ length = security_transition_sid
_user
(ssid, tsid, tclass, &newsid);
if (length < 0)
goto out2;
if (length < 0)
goto out2;
@@
-803,10
+801,6
@@
static ssize_t sel_read_bool(struct file *filep, char __user *buf,
goto out;
}
goto out;
}
- if (count > PAGE_SIZE) {
- ret = -EINVAL;
- goto out;
- }
page = (char *)get_zeroed_page(GFP_KERNEL);
if (!page) {
ret = -ENOMEM;
page = (char *)get_zeroed_page(GFP_KERNEL);
if (!page) {
ret = -ENOMEM;
@@
-983,6
+977,8
@@
static int sel_make_bools(void)
u32 sid;
/* remove any existing files */
u32 sid;
/* remove any existing files */
+ for (i = 0; i < bool_num; i++)
+ kfree(bool_pending_names[i]);
kfree(bool_pending_names);
kfree(bool_pending_values);
bool_pending_names = NULL;
kfree(bool_pending_names);
kfree(bool_pending_values);
bool_pending_names = NULL;