lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1174668728.18725.2.camel@localhost.localdomain>
Date:	Fri, 23 Mar 2007 12:52:08 -0400
From:	Mimi Zohar <zohar@...ux.vnet.ibm.com>
To:	linux-kernel@...r.kernel.org
Cc:	safford@...son.ibm.com, serue@...ux.vnet.ibm.com,
	kjhall@...ux.vnet.ibm.com, zohar@...ibm.com, akpm@...l.org
Subject: [Patch -mm 1/1] SLIM LSM getprocattr hook API change

This patch addresses the 2.6.21-rc4 LSM getprocattr hook API change.

signed-off-by: Mimi Zohar <zohar@...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;
 }
 
 /*



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ