LKML Archive on
help / color / mirror / Atom feed
* DOS by unprivileged user
@ 2018-04-19 19:13 Ferry Toth
  2018-04-20  4:46 ` Mike Galbraith
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Ferry Toth @ 2018-04-19 19:13 UTC (permalink / raw)
  To: linux-kernel

It appears any ordinary user can easily create a DOS on linux.

One sure way to reproduce this is to open gitk on the linux kernel repo 
(SIC) on a machine with 8GB RAM 16 GB swap on a HDD with btrfs and quad core 
+ hyperthreading. But I will be easy enough to get the same effect with more 
RAM, other fs etc.

In this case gitk allocates more and more memory (until my system freezes 
6.5GB of 7.5GB avaiable), the system starts swapping or writing to tmp files 
(can't investigate as there is no time until it freezes) and the io wait 
goes to 100% on all cores. At this point it is impossible to login from 
remote and local keyboard and mouse are frozen. Hard reset is the only way 
out at this point.

IMHO there is something wrong in how the kernel hands out resources, in this 
case memory, CPU time and disk accesses. It should be easily measurable that 
a single application is allocating all memory and consequently all CPU time 
is spent in io wait. I'm pretty sure that if the kernel would stop or reduce 
allocating CPU time to the hogging (user) process causing excessive io wait, 
the machine would continue just fine. And probably a single process should 
not even be allowed to allocate this amount of memory. Or at least should 
not force other applications to get swapped out.

In effect gitk should have beeb forced to run slow or be killed off (which 
doesn't happen because probably the kernel itself doesn't receive enough CPU 

As a positive side effect maybe someone would dig into gitk and make it less 
memory hungry (qgit is half as hungry, still a lot).

Ferry Toth

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-04-30 10:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 19:13 DOS by unprivileged user Ferry Toth
2018-04-20  4:46 ` Mike Galbraith
2018-04-20  8:39   ` Ferry Toth
2018-04-20 12:37     ` Mike Galbraith
2018-04-22 10:16 ` Pavel Machek
2018-04-22 17:43   ` vcaputo
2018-04-23  0:27     ` Michal Hocko
2018-04-23  7:13       ` Pavel Machek
     [not found] ` <4285098.DEWjdbWF2X@delfion>
     [not found]   ` <>
     [not found]     ` <6057755.ozdVOybsI6@delfion>
2018-04-23  8:04       ` Mike Galbraith
2018-04-25 14:54         ` Alan Cox
2018-04-25 16:21           ` Mike Galbraith
2018-04-25 16:50           ` Mike Galbraith
2018-04-30 10:00           ` Ferry Toth
2018-04-30 10:35             ` Miguel Ojeda

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).