From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbdGDQJ1 (ORCPT ); Tue, 4 Jul 2017 12:09:27 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59237 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbdGDQJ0 (ORCPT ); Tue, 4 Jul 2017 12:09:26 -0400 From: Colin King To: Ingo Molnar , Al Viro , Luc Van Oostenryck , Steven Whitehouse , Deepa Dinamani , Waiman Long Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][-next] mqueue: fix incorrect memset size for object v Date: Tue, 4 Jul 2017 17:09:19 +0100 Message-Id: <20170704160919.19406-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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