Very large font size crashing X Font Server and Grounding Serverto a Halt (was: remote DoS in Mozilla 1.0)

Very large font size crashing X Font Server and Grounding Serverto a Halt (was: remote DoS in Mozilla 1.0)

Post by Bryan Anderse » Sat, 15 Jun 2002 19:50:08




> In this case,
> either the process grows very quickly, or is just plain big. I think the
> out-of-memory killer should target big or growing processes. If it doesn't
> hit the correct process the first time, it will free up a lot more RAM
> than it would otherwise, and it would be likely to get it right the second
> time.

Um, so you want to kill the database server?  Think carefully
about making automatic selections like that.  Wouldn't it be
much better to just tell a process that makes a memory request
that won't fit that it can't have it?  The process can then
decide on it's own if it is capable of continuing or aborting.

The real solution lies in getting rid of over subscription and
properly returning NULL for memory allocations when RAM+SWAP
has run out.  To me this is a kernel memory subsystem issue.  
When the X font server requested that huge block of memory it
should have been told you can't have it as there is no way it
would fit within RAM+SWAP-other processes.  No need to kill a
process.

--

| Buzzwords are like annoying little flies that deserve to be swatted. |
|      "Linux, the OS Microsoft doesn't want you to know about.".      |
|   -Bryan Andersen                                                    |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Very large font size crashing X Font Server and Grounding Serverto a Halt (was: remote DoS in Mozilla 1.0)

Post by Helge Haftin » Sat, 15 Jun 2002 20:10:08


[...]
Quote:> However, one circumstance that throwing lots of swap around doesn't
> fix is when a process has an insatiable need for memory. In this case,
> either the process grows very quickly, or is just plain big. I think the
> out-of-memory killer should target big or growing processes. If it doesn't
> hit the correct process the first time, it will free up a lot more RAM
> than it would otherwise, and it would be likely to get it right the second
> time.

A fork bomb would kill everything else in your machine then.  The bomb
program doesn't grow and is smaller than anythine else - but there's
so many of them.  So all the other useful programs,
including shells, are killed. :-(

Helge Hafting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Very large font size crashing X Font Server and Grounding Server to a Halt (was: remote DoS in Mozilla 1.0)

To answer a couple of the questions in this thread.

The Type 1 backend currently in XFree86 (originally by IBM and
Lexmark) uses static memory allocation (it was designed for embedded
systems) and does indeed have very poor error handling.  The current
plan is to replace the Type 1 backend altoghether with a unified Type
1 and TrueType backend based on the FreeType library.  This will
hopefully happen in 4.3.0.

As far as I know, nobody is currently working on fixing the (legacy)
Type 1 backend.  While patches to fix its behaviour are likely to get
accepted, I think that getting the Type 1 backend to work reasonably
is more work than it's worth now that FreeType does a decent job with
Type 1 fonts.

As to out of memory allocations: with a few exceptions, the core X
server code deals smartly with malloc returning NULL: the current
client receives a BadAlloc error (``insufficient resources''), and
other clients are not bothered.  (On the other hand, it is a rare
client that will deal gracefully with a BadAlloc; and if it's your
window manager that gets the error, all hell breaks loose.)

With current Linux kernels, this careful coding brings no benefit
whatsover, as malloc never (?) returns NULL.  What is worse, as far as
I know the kernel doesn't send advance warning of an OOM situation; it
would not be too difficult to stop allocating memory when that happens.

I suggest xpert at xfree86.org as the right list to continue this
discussion.  If you follow up on linux-kernel, please be so kind as to
CC me.

Regards,

                                        Juliusz Chroboczek

P.S. As always, none of the above represents an official position of
the XFree86 project, but merely my personal perception of the
situation.  This message may or may not have any sort of relationship
with reality.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Printer interface

3. comp.unix.sco.misc Technical FAQ (1/2)

4. KDE Font Installer crashes, then smashes fonts

5. RANDOM in ksh

6. Changing AixTerm font/font size

7. HOST QUERY

8. Fonts are to small at 1600x1200, How I can change all fonts to a larger size?

9. How do I set the default font and font size for XTerm

10. printing font size in Mozilla/Galeon

11. FONTS FONTS AND MORE FONTS

12. FONTS FONTS FONTS... LOTS OF THEM!!!!!!!