Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5ec371b7
Commit
5ec371b7
authored
Oct 21, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Oct 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ipc msg race fix
Backport this fix from 2.4
parent
dd329e9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
ipc/msg.c
ipc/msg.c
+10
-1
No files found.
ipc/msg.c
View file @
5ec371b7
...
...
@@ -837,11 +837,20 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz,
msg_unlock
(
msq
);
schedule
();
current
->
state
=
TASK_RUNNING
;
/*
* The below optimisation is buggy. A sleeping thread that is
* woken up checks if it got a message and if so, copies it to
* userspace and just returns without taking any locks.
* But this return to user space can be faster than the message
* send, and if the receiver immediately exits the
* wake_up_process performed by the sender will oops.
*/
#if 0
msg = (struct msg_msg*) msr_d.r_msg;
if(!IS_ERR(msg))
goto out_success;
#endif
msq
=
msg_lock
(
msqid
);
msg
=
(
struct
msg_msg
*
)
msr_d
.
r_msg
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment