Merge pull request #17304 from mupuf/podman_4.4_regression

Do not mount /dev/tty into rootless containers
This commit is contained in:
OpenShift Merge Robot 2023-01-31 16:56:53 -05:00 committed by GitHub
commit 68bbdc283f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,11 +117,12 @@ func AddPrivilegedDevices(g *generate.Generator, systemdMode bool) error {
* the rootless containers for security reasons, and
* the container runtime will create it for us
* anyway (ln -s /dev/pts/ptmx /dev/ptmx);
* /dev/tty and
* /dev/tty[0-9]+: Prevent the container from taking over the host's
* virtual consoles, even when not in systemd mode
* for backwards compatibility.
*/
if d.Path == "/dev/ptmx" || isVirtualConsoleDevice(d.Path) {
if d.Path == "/dev/ptmx" || d.Path == "/dev/tty" || isVirtualConsoleDevice(d.Path) {
continue
}
if _, found := mounts[d.Path]; found {