Fork bomb in bash results in BSOD
After running the fork bomb :(){ :|:& };: my entire Windows crashed with a BSOD "CRITICAL_PROCESS_DIED", see below for complete line from nirsoft bluescreenview.
Of course I expected that my system to become possible unresponsive due to CPU usage and possible memory. However, a BSOD "CRITICAL_PROCESS_DIED" was not what I expected and I think that you should not be able to crash Windows in such a way from bash.
042016-17156-01.dmp 2016-04-20 17:04:12 CRITICAL_PROCESS_DIED 0x000000ef ffff9387df45f800 0000000000000000 0000000000000000 0000000000000000 ntoskrnl.exe ntoskrnl.exe+1484b0 x64 ntoskrnl.exe+1484b0 C:\WINDOWS\Minidump\042016-17156-01.dmp 10 15 14316 236,812 2016-04-20 17:05:21
Can you share the minidump? I can take a look and route it to the right team.
@Magnificus36 Thanks for providing the dump. Unfortunately there isn't enough state in the minidump to determine which svchost is crashing. Would it be possible to look in your event viewer (custom views -> Administrative Events) around 17:04 and see which service is dying?
Thanks for providing the event logs. You're right, this is dwm crashing because it failed to allocate memory:
Error code: (NTSTATUS) 0xc00001ad (3221225901) - The process has terminated because it could not allocate additional memory.
We have somebody on our team investigating a mitigation for the fork bomb issue. I definitely agree with the statement in your original post that WSL shouldn't be able to bugcheck the machine by putting the machine under extreme memory pressure.
Thanks again for reporting the issue.
You can already do this from a Win32 process, so this doesn't appear to be a WSL issue.
You can bluescreen by merely allocating too much memory under Win32? I guess nobody should consider Linux (the real one) overcommit and OOM killing to be an issue anymore then :p
I just tried fork-bombing on 14328; just caused my system to grind to a halt. As the OP mentioned, the BSOD was due to a basic Windows NT system process being killed due to running out of resources during the overload.
Most linux distros use ulimit to prevent fork bombing from crashing the system. the limits can be be configured in /etc/security/limits.conf In Linux these limits are enforced in the kernel. I'm not familiar off hand with the method used to get this configuration into the kernel, or if WSL even supports them.
If WSL does not support them yet, then this is a WSL issue.
@bogen - That's correct, and something we are aware of. Thanks for bringing it up and providing the feedback.
We have mitigated the impact of fork bombs so they should no longer cause bugchecks in our driver or other Windows components. Please reopen if you are still able to hit this.
@benhillis I just tried this today and it crashed Windows. I am using Version 10.0.16299 Build 16299.
@dtrailin do you have a crashdump?
@benhillis Sure, uploaded here
@benhillis I tried Fork Bombing today on Microsoft Windows [Version 10.0.16299.125]
It showed Not Responding on the wsl process and then the process crashed.
Nothing else happened.