* [Patch -mm 1/1] SLIM LSM getprocattr hook API change
@ 2007-03-23 16:52 Mimi Zohar
0 siblings, 0 replies; only message in thread
From: Mimi Zohar @ 2007-03-23 16:52 UTC (permalink / raw)
To: linux-kernel; +Cc: safford, serue, kjhall, zohar, akpm
This patch addresses the 2.6.21-rc4 LSM getprocattr hook API change.
signed-off-by: Mimi Zohar <zohar@us.ibm.com>
---
Index: linux-2.6.21-rc4-mm1/security/slim/slm_main.c
===================================================================
--- linux-2.6.21-rc4-mm1.orig/security/slim/slm_main.c
+++ linux-2.6.21-rc4-mm1/security/slim/slm_main.c
@@ -1269,25 +1269,29 @@ static int slm_setprocattr(struct task_s
}
static int slm_getprocattr(struct task_struct *tsk,
- char *name, void *value, size_t size)
+ char *name, char **value)
{
struct slm_tsec_data *tsec = tsk->security;
size_t len = 0;
+ int buf_size = 31;
+ char buf[buf_size];
if (is_kernel_thread(tsk))
- len = snprintf(value, size, "KERNEL");
+ len = snprintf(buf, buf_size, "KERNEL");
else {
spin_lock(&tsec->lock);
if (tsec->iac_wx != tsec->iac_r)
- len = snprintf(value, size, "GUARD wx:%s r:%s",
+ len = snprintf(buf, buf_size, "GUARD wx:%s r:%s",
slm_iac_str[tsec->iac_wx],
slm_iac_str[tsec->iac_r]);
else
- len = snprintf(value, size, "%s",
+ len = snprintf(buf, buf_size, "%s",
slm_iac_str[tsec->iac_wx]);
spin_unlock(&tsec->lock);
}
- return min(len, size);
+ *value = kzalloc(len, GFP_KERNEL);
+ memcpy(*value, buf, len);
+ return len;
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-03-23 16:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-23 16:52 [Patch -mm 1/1] SLIM LSM getprocattr hook API change Mimi Zohar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome