All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] landlock: Initialize kernel stack variables properly
@ 2021-11-03  7:14 Austin Kim
  2021-11-03 12:17 ` Mickaël Salaün
  0 siblings, 1 reply; 4+ messages in thread
From: Austin Kim @ 2021-11-03  7:14 UTC (permalink / raw)
  To: mic, serge; +Cc: serge, linux-security-module, linux-kernel, austindh.kim

In case kernel stack variables are not initialized properly, there might 
be a little chance of kernel information disclosure. So it is better for 
kernel stack variables to be initialized with null characters.

Signed-off-by: Austin Kim <austindh.kim@gmail.com>
---
 security/landlock/syscalls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/landlock/syscalls.c b/security/landlock/syscalls.c
index 32396962f04d..50a6f7091428 100644
--- a/security/landlock/syscalls.c
+++ b/security/landlock/syscalls.c
@@ -320,6 +320,8 @@ SYSCALL_DEFINE4(landlock_add_rule,
 	if (rule_type != LANDLOCK_RULE_PATH_BENEATH)
 		return -EINVAL;
 
+	memset(&path_beneath_attr, 0, sizeof(path_beneath_attr));
+
 	/* Copies raw user space buffer, only one type for now. */
 	res = copy_from_user(&path_beneath_attr, rule_attr,
 			sizeof(path_beneath_attr));
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-05 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03  7:14 [PATCH] landlock: Initialize kernel stack variables properly Austin Kim
2021-11-03 12:17 ` Mickaël Salaün
2021-11-04 11:41   ` Austin Kim
2021-11-05 16:58     ` J Freyensee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.