ipc: fix local variable initialization in compat_do_msg_fill()
PATCH 1/1 ipc: fix local variable initialization in compat_do_msg_fill()
The "msgp" must points to the userspace buffer.
fix for linux-next commit 774d0252d303969a7281eefd6eaccde50bb6eb6e ("c/r: ipc: message queue receive cleanup")
Signed-off-by Konstantin Khlebnikov <[email protected]>
Cc Stanislav Kinsbursky <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Chris Metcalf <[email protected]>
Cc Cyrill Gorcunov <[email protected]>
Cc Pavel Emelyanov <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Andrew Morton <[email protected]>
--- ipc/compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ipc/compat.c +1 -1
@@ -363,7 +363,7 @@ static long compat_do_msg_steal(void __user *dest, struct msg_msg *msg, size_t blong compat_do_msg_fill (void __user *dest,struct msg_msg *msg,size_t bufsz) { -struct compat_msgbuf __user *msgp; +struct compat_msgbuf __user *msgp = dest;size_t msgsz;if (put_user (msg->m_type, &msgp->mtype))
Quoted 4 lines · Konstantin Khlebnikov
The "msgp" must points to the userspace buffer.
fix for linux-next commit
774d0252d303969a7281eefd6eaccde50bb6eb6e("c/r: ipc: message queue receive cleanup")
Oops, Dan Carpenter had caught this several days before me:
[patch] c/r: ipc: uninitialized variable in compat_do_msg_fill()
Quoted 27 lines
Signed-off-by Konstantin Khlebnikov<[email protected]>Cc Stanislav Kinsbursky<[email protected]>Cc Lucas De Marchi<[email protected]>Cc Chris Metcalf<[email protected]>Cc Cyrill Gorcunov<[email protected]>Cc Pavel Emelyanov<[email protected]>Cc Arnd Bergmann<[email protected]>Cc Andrew Morton<[email protected]>--- ipc/compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)ipc/compat.c +1
-1@@ -363,7 +363,7 @@ static long compat_do_msg_steal(void __user *dest, struct msg_msg *msg, size_t blong compat_do_msg_fill (void __user *dest,struct msg_msg *msg,size_t bufsz) { -struct compat_msgbuf __user *msgp; +struct compat_msgbuf __user *msgp = dest;size_t msgsz;if (put_user (msg->m_type,&msgp->mtype))