lkml.org 
[lkml]   [2001]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject2.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;
\
 
 \ /
  Last update: 2005-03-22 13:02    [W:0.032 / U:20.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site