From 5dd3194e66437319b5f79c236cabb91e1aa4791e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 6 Nov 2015 18:04:49 +0000 Subject: [PATCH] scst_user: Avoid leaking kernel data to user space There is a hole in struct scst_user_opt so that structure must be zero-initialized to avoid leaking kernel data to user space. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6601 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index c4c65a2a2..45288befd 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -3777,6 +3777,7 @@ static int dev_user_get_opt(struct file *file, void __user *arg) if (unlikely(res != 0)) goto out; + memset(&opt, 0, sizeof(opt)); opt.parse_type = dev->parse_type; opt.on_free_cmd_type = dev->on_free_cmd_type; opt.memory_reuse_type = dev->memory_reuse_type;