https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux....
I think it's quite readable and one could modify it easily to whitelist open on "/dev/null".