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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170704160919.19406-1-colin.king@canonical.com>
Date:   Tue,  4 Jul 2017 17:09:19 +0100
From:   Colin King <colin.king@...onical.com>
To:     Ingo Molnar <mingo@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
        Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
        Steven Whitehouse <swhiteho@...hat.com>,
        Deepa Dinamani <deepa.kernel@...il.com>,
        Waiman Long <longman@...hat.com>
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][-next] mqueue: fix incorrect memset size for object v

From: Colin Ian King <colin.king@...onical.com>

The size of the memset is incorrect, it is currently using the size
of attr (a struct mq_attr *) and not of v (a struct compat_mq_attr)

Detected by CoverityScan, CID#1449362 ("Wrong sizeof argument")

Fixes: 045256d59da6 ("mqueue: move compat syscalls to native ones")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 ipc/mqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index a1a326569268..c9ff943f19ab 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1449,7 +1449,7 @@ static inline int put_compat_mq_attr(const struct mq_attr *attr,
 {
 	struct compat_mq_attr v;
 
-	memset(&v, 0, sizeof(attr));
+	memset(&v, 0, sizeof(v));
 	v.mq_flags = attr->mq_flags;
 	v.mq_maxmsg = attr->mq_maxmsg;
 	v.mq_msgsize = attr->mq_msgsize;
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ