linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Austin Kim <austindh.kim@gmail.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	austindh.kim@gmail.com
Subject: [PATCH] xfs: Initialize label array properly
Date: Fri, 30 Aug 2019 14:37:07 +0900	[thread overview]
Message-ID: <20190830053707.GA69101@LGEARND20B15> (raw)

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


             reply	other threads:[~2019-08-30  5:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30  5:37 Austin Kim [this message]
2019-08-30  5:39 ` [PATCH] xfs: Initialize label array properly Darrick J. Wong
2019-08-30 14:53   ` Austin Kim
2019-08-30  7:31 ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190830053707.GA69101@LGEARND20B15 \
    --to=austindh.kim@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).