netblue30 / firejail

Linux namespaces and seccomp-bpf sandbox
https://firejail.wordpress.com
GNU General Public License v2.0
5.84k stars 568 forks source link

Feature Request: Support for time namespaces (Linux 5.6) #3738

Open rhencke opened 4 years ago

rhencke commented 4 years ago

As of Linux 5.6, a new namespace was added for time.

Within each time namespace, you can set:

This allows you to run programs as if they were running in the past or future, without modifying the system clock.

Here are some of the things I would like to do with such a feature, if it existed:

Is this an idea that firejail would be open to? (I'd be happy to hack on a PR if so.)

reinerh commented 4 years ago

I agree, that sounds like a good idea and would be cool to have. :-)

rhencke commented 4 years ago

My apologies... I did not read the Linux patch close enough...

CLOCK_REALTIME - System-wide clock that measures real (i.e., wall-clock) time.

For many users, the time namespace means the ability to changes date and time in a container (CLOCK_REALTIME). Providing per namespace notions of CLOCK_REALTIME would be complex with a massive overhead, but has a dubious value.

So.. it.. doesn't namespace the one part of time that would have been interesting, currently. Well.. maybe in Linux 7.12 or so.. (sorry for the noise - you can close this as 'currently impossible'.. d'oh)