summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95ffc2b)
raw | patch | inline | side by side (parent: 95ffc2b)
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | |
Mon, 1 Apr 2013 07:40:51 +0000 (11:40 +0400) | ||
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
Wed, 17 Apr 2013 04:48:28 +0000 (21:48 -0700) |
commit 2dc958fa2fe6987e7ab106bd97029a09a82fcd8d upstream.
Make sure that msg pointer is set back to error value in case of
MSG_COPY flag is set and desired message to copy wasn't found. This
garantees that msg is either a error pointer or a copy address.
Otherwise the last message in queue will be freed without unlinking from
the queue (which leads to memory corruption) and the dummy allocated
copy won't be released.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Make sure that msg pointer is set back to error value in case of
MSG_COPY flag is set and desired message to copy wasn't found. This
garantees that msg is either a error pointer or a copy address.
Otherwise the last message in queue will be freed without unlinking from
the queue (which leads to memory corruption) and the dummy allocated
copy won't be released.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ipc/msg.c | patch | blob | history |
diff --git a/ipc/msg.c b/ipc/msg.c
index 31cd1bf6af271771e67bdf6e29eb306371d3d130..fede1d06ef305cc59386bb4490c7e2e020b9f25d 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
goto out_unlock;
break;
}
+ msg = ERR_PTR(-EAGAIN);
} else
break;
msg_counter++;