Messages in this thread Patches in this message |  | | Date | Sat, 8 Sep 2001 05:14:34 -0400 (EDT) | From | Francis Galiegue <> | Subject | 2.4.9-ac9 bug + patch |
| |
Also in 2.4.7, 2.4.9, 2.4.9-ac4, 2.4.9-ac6.
fs/locks.c, line 693:
---- int locks_mandatory_area(int read_write, struct inode *inode, struct file *filp, loff_t offset, size_t count) { struct file_lock *fl; struct file_lock *new_fl = locks_alloc_lock(0); int error;
new_fl->fl_owner = current->files; [...] ----
No check on whether locks_alloc_lock() succeeds. Or do I miss something?
Patch follows:
--- fs/locks.c Fri Sep 7 23:06:49 2001 +++ fs/locks.c.new Sat Sep 8 01:03:50 2001 @@ -698,6 +698,9 @@ struct file_lock *new_fl = locks_alloc_lock(0); int error;
+ if (new_fl == NULL) + return -ENOMEM; + new_fl->fl_owner = current->files; new_fl->fl_pid = current->pid; new_fl->fl_file = filp; -- Francis Galiegue, fg@mandrakesoft.com - Normand et fier de l'être "Programming is a race between programmers, who try and make more and more idiot-proof software, and universe, which produces more and more remarkable idiots. Until now, universe leads the race" -- R. Cook
--- fs/locks.c Fri Sep 7 23:06:49 2001 +++ fs/locks.c.new Sat Sep 8 01:03:50 2001 @@ -698,6 +698,9 @@ struct file_lock *new_fl = locks_alloc_lock(0); int error; + if (new_fl == NULL) + return -ENOMEM; + new_fl->fl_owner = current->files; new_fl->fl_pid = current->pid; new_fl->fl_file = filp;
|  |