vlang / vinix

Vinix is an effort to write a modern, fast, and useful operating system in the V programming language

Home Page:https://vlang.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panic when executing specially-crafted file

hyperfocusaurus opened this issue · comments

If you create a file called /bin/loop with the following contents:

#!/bin/loop

The VINIX kernel will infinitely recurse in the userland.start_program function, until it eventually runs out of stack space and panics.

The way Linux deals with this case is by keeping track of the recursion depth, and setting errno = ELOOP and returning if the arbitrary max depth is reached (I believe the depth is 4 on linux, but don't quote me on that).