2 ms·
A popular example given for this is often pcap/tcpdump filters— for perf reasons they have to be executed by the kernel, but because they're an untrusted user "
by mikepurvis 5y ago
A popular example given for this is often pcap/tcpdump filters— for perf reasons they have to be executed by the kernel, but because they're an untrusted user "program" being run in kernel space, they can only ever jump forward, ensuring an upper bound on their runtime.
See: https://en.wikipedia.org/wiki/Berkeley_Packet_Filter https://en.wikipedia.org/wiki/Berkeley_Packet_Filter
That said, it looks like as of Linux 5.3+, there are certain bounded loops that are permissible: https://lwn.net/Articles/794934/ https://lwn.net/Articles/794934/