From: Francis Galiegue <fg@mandrakesoft.com>
To: <linux-kernel@vger.kernel.org>
Subject: 2.4.9-ac9 bug + patch
Date: Sat, 8 Sep 2001 05:14:34 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.30.0109080513360.4681-200000@toy.mandrakesoft.com> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1004 bytes --]
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
[-- Attachment #2: Type: TEXT/PLAIN, Size: 320 bytes --]
--- 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;
next reply other threads:[~2001-09-08 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-08 9:14 Francis Galiegue [this message]
2001-09-08 9:21 ` 2.4.9-ac9 bug + patch Francis Galiegue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.30.0109080513360.4681-200000@toy.mandrakesoft.com \
--to=fg@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).