lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] xfs: Initialize label array properly
In case kernel stack variable is not initialized properly,
there is a risk of kernel information disclosure.

So, initialize 'char label[]' array with null characters.

Signed-off-by: Austin Kim <austindh.kim@gmail.com>
---
fs/xfs/xfs_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 9ea5166..09b3bee 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -2037,7 +2037,7 @@ xfs_ioc_setlabel(
char __user *newlabel)
{
struct xfs_sb *sbp = &mp->m_sb;
- char label[XFSLABEL_MAX + 1];
+ char label[XFSLABEL_MAX + 1] = {0};
size_t len;
int error;

--
2.6.2
\
 
 \ /
  Last update: 2019-08-30 07:37    [W:0.059 / U:3.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site