* [PATCH][-next] mqueue: fix incorrect memset size for object v
@ 2017-07-04 16:09 ` Colin King
0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-07-04 16:09 UTC (permalink / raw)
To: Ingo Molnar, Al Viro, Luc Van Oostenryck, Steven Whitehouse,
Deepa Dinamani, Waiman Long
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.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@canonical.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH][-next] mqueue: fix incorrect memset size for object v
@ 2017-07-04 16:09 ` Colin King
0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-07-04 16:09 UTC (permalink / raw)
To: Ingo Molnar, Al Viro, Luc Van Oostenryck, Steven Whitehouse,
Deepa Dinamani, Waiman Long
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.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@canonical.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][-next] mqueue: fix incorrect memset size for object v
2017-07-04 16:09 ` Colin King
@ 2017-07-04 17:13 ` Al Viro
-1 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2017-07-04 17:13 UTC (permalink / raw)
To: Colin King
Cc: Ingo Molnar, Luc Van Oostenryck, Steven Whitehouse,
Deepa Dinamani, Waiman Long, kernel-janitors, linux-kernel
On Tue, Jul 04, 2017 at 05:09:19PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.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)
Folded (and that was a moderate infoleak - ->__reserved[] thing had
been copied out uninitialized).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][-next] mqueue: fix incorrect memset size for object v
@ 2017-07-04 17:13 ` Al Viro
0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2017-07-04 17:13 UTC (permalink / raw)
To: Colin King
Cc: Ingo Molnar, Luc Van Oostenryck, Steven Whitehouse,
Deepa Dinamani, Waiman Long, kernel-janitors, linux-kernel
On Tue, Jul 04, 2017 at 05:09:19PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.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)
Folded (and that was a moderate infoleak - ->__reserved[] thing had
been copied out uninitialized).
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-04 17:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-04 16:09 [PATCH][-next] mqueue: fix incorrect memset size for object v Colin King
2017-07-04 16:09 ` Colin King
2017-07-04 17:13 ` Al Viro
2017-07-04 17:13 ` Al Viro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.