CVE-2015-6565 openssh: Incorrectly set TTYs to be world-writable fix pty permissions; patch from Nikolay Edigaryev; ok deraadt Upstream-Status: Backport merged two changes into one. [1] https://anongit.mindrot.org/openssh.git/commit/sshpty.c?id=a5883d4eccb94b16c355987f58f86a7dee17a0c2 tighten permissions on pty when the "tty" group does not exist; pointed out by Corinna Vinschen; ok markus [2] https://anongit.mindrot.org/openssh.git/commit/sshpty.c?id=6f941396b6835ad18018845f515b0c4fe20be21a fix pty permissions; patch from Nikolay Edigaryev; ok deraadt Signed-off-by: Armin Kuster Index: openssh-6.7p1/sshpty.c =================================================================== --- openssh-6.7p1.orig/sshpty.c +++ openssh-6.7p1/sshpty.c @@ -196,13 +196,8 @@ pty_setowner(struct passwd *pw, const ch /* Determine the group to make the owner of the tty. */ grp = getgrnam("tty"); - if (grp) { - gid = grp->gr_gid; - mode = S_IRUSR | S_IWUSR | S_IWGRP; - } else { - gid = pw->pw_gid; - mode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; - } + gid = (grp != NULL) ? grp->gr_gid : pw->pw_gid; + mode = (grp != NULL) ? 0620 : 0600; /* * Change owner and mode of the tty as required.