Re: vnode_pager_putpages errors and DOS? [5-STABLE, too]

2004-11-24 Thread Oliver Brandmueller
Hi.

On Mon, Nov 22, 2004 at 05:02:00PM +0100, Uwe Doering wrote:
> With the attached test program you'll probably find out soon whether PR 
> and fix apply to RELENG_5 (and possibly above) as well.  Please keep us 
> posted.

I was able to DoS the machine (non-root user!) on 5-STABLE as of today 
without the patch with your program.

With the patch applied to 5-STABLE the machine keeps responsive and is 
running fine.

So, please committers, commit this fix to 5-STABLE and 4-STABLE!

- Oliver

-- 
| Oliver Brandmueller | Offenbacher Str. 1  | Germany   D-14197 Berlin |
| Fon +49-172-3130856 | Fax +49-172-3145027 | WWW:   http://the.addict.de/ |
|   Ich bin das Internet. Sowahr ich Gott helfe.   |
| Eine gewerbliche Nutzung aller enthaltenen Adressen ist nicht gestattet! |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: vnode_pager_putpages errors and DOS? [5-STABLE, too]

2004-11-22 Thread Uwe Doering
Oliver Brandmueller wrote:
On Fri, Nov 05, 2004 at 10:08:18PM +0100, Uwe Doering wrote:
I've attached an updated version of the patch for 'vnode_pager.c'.  On 
my test system it resolved the issue.  Please let us know whether it 
works for you as well.
Is there any known way to trigger the problem? I did not yet run into 
any trouble, but actually I don't want to :-)
After a brief search I found my test program again.  Please find it 
attached to this email.  As far as I can tell it should still work. 
Nothing complicated, in fact.  The program just creates and mmaps a file 
that is slightly larger than the available disk space, and then modifies 
all pages within the mmapped area so that the syncer has to flush them 
out to disk.

In case you would like to try it, please adjust FILENAME and FILELEN. 
FILELEN is supposed to be slightly larger than the available disk space. 
 I ran my tests on a 100 MB file system mounted under '/', since that 
was the smalles FS available on that computer.  After 30 seconds at max 
an unpatched system ought to become unresponsive due to the indefinite 
loop I described earlier.

The patch applies cleanly to 5-STABLE as of today and as far as I could 
see there were no changes to the code which obsolete this patch.
With the attached test program you'll probably find out soon whether PR 
and fix apply to RELENG_5 (and possibly above) as well.  Please keep us 
posted.

   Uwe
--
Uwe Doering |  EscapeBox - Managed On-Demand UNIX Servers
[EMAIL PROTECTED]  |  http://www.escapebox.net
#include 
#include 
#include 
#include 
#include 
#include 

#define FILENAME"/mnt/test" /* where to put the test file */
#define FILELEN 110 /* test file length in MB */

main()
{
int fd;
size_t len;
char *buf, *p, *lim;

len = FILELEN * 1024 * 1024;

if ((fd = open(FILENAME, O_RDWR|O_CREAT|O_TRUNC, 0666)) == -1)
err(2, "open() failed");

if (ftruncate(fd, len) == -1)
err(2, "ftruncate() failed");

buf = mmap(NULL, len, PROT_WRITE, MAP_SHARED, fd, 0);
if (buf == MAP_FAILED)
err(2, "mmap() failed");
(void)close(fd);

for (p = buf, lim = p + len; p < lim; p += 4096)
*p = '0';

if (munmap(buf, len) == -1)
err(2, "munmap() failed");

exit(0);
}
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: vnode_pager_putpages errors and DOS? [5-STABLE, too]

2004-11-22 Thread Oliver Brandmueller
Hi Uwe,
hi comitters.

On Fri, Nov 05, 2004 at 10:08:18PM +0100, Uwe Doering wrote:
> I've attached an updated version of the patch for 'vnode_pager.c'.  On 
> my test system it resolved the issue.  Please let us know whether it 
> works for you as well.

Is there any known way to trigger the problem? I did not yet run into 
any trouble, but actually I don't want to :-)

The patch applies cleanly to 5-STABLE as of today and as far as I could 
see there were no changes to the code which obsolete this patch.

- Oliver

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--
|--- src/sys/vm/vnode_pager.c.orig  Tue Dec 31 10:34:51 2002
|+++ src/sys/vm/vnode_pager.c   Fri Nov  5 20:41:15 2004
--
Patching file src/sys/vm/vnode_pager.c using Plan A...
Hunk #1 succeeded at 994 with fuzz 2 (offset 40 lines).
Hunk #2 succeeded at 1040 (offset 3 lines).
done


-- 
| Oliver Brandmueller | Offenbacher Str. 1  | Germany   D-14197 Berlin |
| Fon +49-172-3130856 | Fax +49-172-3145027 | WWW:   http://the.addict.de/ |
|   Ich bin das Internet. Sowahr ich Gott helfe.   |
| Eine gewerbliche Nutzung aller enthaltenen Adressen ist nicht gestattet! |
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"