From: msb@cats.ucsc.edu (Maurice S Barnum) Subject: Re: 99pl12 hard crash? Date: 2 Sep 1993 05:42:23 GMT
In <1993Sep1.123224.628@mkseast.alt.ns.ca> dale@mkseast.alt.ns.ca (Dale Gass) writes:
>I've been experiencing similar crashes, and I haven't seen the referenced
>patch, either. Maybe a repost is in order (if it's not big)... Failing that,
>could somebody email me the patch?
this isn't one of the "alpha diffs" but a short patch that Linus
mailed to the activists list. (I hope nobody that this is the one
"small patch" being referred to, and that no one minds me reposting
this).
---begin included file
From: Linus.Torvalds@cs.Helsinki.FI (Linus Torvalds)
Subject: Small patch to pl12
Date: Wed, 18 Aug 1993 00:29:10 +0300
Here is a truly small patch to pl12 that should hopefully fix some
problems: the first actually being a possible lock-up under some
circumstances. The other patches are just added checks in mmap() to
make MAP_SHARED + PROT_WRITE type mmap's fail gracefully (instead of the
unpatched behaviour where the mmap returns successfully, but the
mmapping doesn't actually work as it should: linux doesn't do write
mappings yet).
The uuencoded stuff is the same patch, just in case your mailer eats
whitespace (actually, the patches are so small that they are probably
easier to add by hand anyway).
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 */
==========
begin 644 diff.gz
M'XL( &5&<2P" -637V_:,!3%GY-/<?=2$5*/.H$"04.P":IJ75>Q/WVT KD!
M:XD=.0YMMW[X.0$UH465JCWM(8Y]?,^U]3M)Q.,82 &$*%P5*N=;-'.!=R3F
M">:0)=3K)%P4]YTX[Y0:T^$RP?<K.*K:A)!73-87*6!:K &&0/M!EP:>!W0X
M]&W7=8]WM+X76%EH'^@@\+V ^CO+9 *DVSOM@UN-DXD-5JY5L=)0-H!V]1H9
ME0L-W$QL8E4['Z#5*&P[P-@:-8L5(LO"-;8NYC?LXX_Y?+9P1K9[S 3&]=+S
M>;:XGETYY5'FU!A:[\I:QRPLA;I08F1';R(NS).F8=;D76M':->;UK=BQYKV
M@-*@>QZ<^4=8-PP-TIX7^,/ ']2D>V>GY^":<5"1_E/#WJ8L5!BR_;(-:29T
MB<"M$&1*:CB!F^G%C"UN':O3!BF2AYWPZ>LM2 7&'I%*S8LLDTIC!$+>0;MC
MFNS1 9E=7O^<7HWV:*7A> (M+F2$9,Q9OB3CG"T3N?J5\]\&*E"G0?ZY/4$!
M8]CP]8:EF$KU (^/4/8\% F80@?,I<.MY!'(+:HXV5WM#5&FZ6&,3^OG$3YM
M'/PJ@^#,!/(BOKKXU>CHL%]F5[YVX5EXK]$@J0.4&:I0<RERUOC(6=E]5">]
=+.(8%=N8M$S,R\V_AZP,:OT?1/T7_';.!R@% "4
end
--
Maurice S. Barnum --- msb@cats.{ucsc.edu,BITNET}, mbarnum@eis.calstate.edu
You have to believe in free will. You have no choice. --- I.B. Singer