Subject: Very small patch to 0.99pl12

From: [email-masked] (Linus Torvalds)
Date: 18 Aug 1993 09:50:58 -0400

I hate to put out patches this soon after a release, but there is one
potentially major problem in pl12 which is very simple to fix..  I'm
including patches: both in plain ascii and as a uuencoded gzip file
(it's the same patch - the uuencoded one is in case there is any
newsserver that messes up whitespace).

The main patch is just the change from __get_free_page(GFP_BUFFER) into
get_free_page(GFP_KERNEL), and the two minor patches just add checks
that actually enforce the read-only nature of current file mmap'ings so
that any program that tries to do a write mapping at least will be told
that it won't work. 

I'd suggest anybody compiling pl12 should add at least the file_table.c
patch: thanks to Alexandre Julliard for noticing this one. 

		Linus

----------
diff -u --recursive --new-files pl12/linux/fs/file_table.c linux/fs/file_table.c
--- pl12/linux/fs/file_table.c	Mon Aug  9 17:41:22 1993
+++ linux/fs/file_table.c	Tue Aug 17 18:32:13 1993
@@ -45,7 +45,7 @@
 	struct file * file;
 	int i;
 
-	file = (struct file*) __get_free_page(GFP_BUFFER);
+	file = (struct file *) get_free_page(GFP_KERNEL);
 
 	if (!file)
 		return;
diff -u --recursive --new-files pl12/linux/fs/nfs/mmap.c linux/fs/nfs/mmap.c
--- pl12/linux/fs/nfs/mmap.c	Sun Aug 15 11:46:03 1993
+++ linux/fs/nfs/mmap.c	Tue Aug 17 22:39:38 1993
@@ -50,6 +50,8 @@
 {
 	struct vm_area_struct * mpnt;
 
+	if (prot & PAGE_RW)	/* only PAGE_COW or read-only supported now */
+		return -EINVAL;
 	if (off & (inode->i_sb->s_blocksize - 1))
 		return -EINVAL;
 	if (len > high_memory || off > high_memory - len) /* avoid overflow */
diff -u --recursive --new-files pl12/linux/mm/mmap.c linux/mm/mmap.c
--- pl12/linux/mm/mmap.c	Mon Aug  9 18:02:33 1993
+++ linux/mm/mmap.c	Tue Aug 17 22:39:38 1993
@@ -197,6 +197,8 @@
 	extern struct vm_operations_struct file_mmap;
 	struct buffer_head * bh;
 
+	if (prot & PAGE_RW)	/* only PAGE_COW or read-only supported right now */
+		return -EINVAL;
 	if (off & (inode->i_sb->s_blocksize - 1))
 		return -EINVAL;
 	if (len > high_memory || off > high_memory - len) /* avoid overflow */
----------

-- 
Send submissions for comp.os.linux.announce to: [email-masked]