pty: Update slave device permission check to allow 0600
Systemd changed the default permissions for PTY slave devices from 0620 to 0600 in response to CVE-2024-28085. Allow either 0620 or 0600 as valid permissions.
testcases/kernel/pty/common.h +2 -1
@@ -54,7 +54,8 @@ static inline int open_slave(const int masterfd) st.st_uid, uid); } -if (st.st_mode != (S_IFCHR |0620 )) { +if (st.st_mode != (S_IFCHR |0620 ) && + st.st_mode != (S_IFCHR |0600 )) {tst_brk (TBROK ,"unexpected slave device permission: %o" , st.st_mode); }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Cyril Hrubis
Reviewed-byHi!
Quoted 14 lines
Systemd changed the default permissions for PTY slave devices from 0620 to 0600 in response to CVE-2024-28085. Allow either 0620 or 0600 as valid permissions.
Signed-off-by Dan Carpenter <[email protected]>Tested-by Anders Roxell <[email protected]>testcases/kernel/pty/common.h +0
-0
testcases/kernel/pty/common.h static inline int open_slave(const int masterfd) · line 61
Quoted 9 lines
testcases/kernel/pty/common.h +2
-1@@ -54,7 +54,8 @@ static inline int open_slave(const int masterfd) st.st_uid, uid); } -if (st.st_mode != (S_IFCHR |0620 )) { +if (st.st_mode != (S_IFCHR |0620 ) && + st.st_mode != (S_IFCHR |0600 )) {tst_brk (TBROK ,"unexpected slave device permission: %o" , st.st_mode); }
Looks good to me:
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel
Reviewed-byHi all,
Quoted 27 lines
Hi!
Quoted 14 lines
Systemd changed the default permissions for PTY slave devices from 0620 to 0600 in response to CVE-2024-28085. Allow either 0620 or 0600 as valid permissions.
Signed-off-by Dan Carpenter <[email protected]>Tested-by Anders Roxell <[email protected]>testcases/kernel/pty/common.h +0
-0testcases/kernel/pty/common.h static inline int open_slave(const int masterfd) · line 61
Quoted 9 lines
testcases/kernel/pty/common.h +2
-1@@ -54,7 +54,8 @@ static inline int open_slave(const int masterfd) st.st_uid, uid); } -if (st.st_mode != (S_IFCHR |0620 )) { +if (st.st_mode != (S_IFCHR |0620 ) && + st.st_mode != (S_IFCHR |0600 )) {tst_brk (TBROK ,"unexpected slave device permission: %o" , st.st_mode); }Looks good to me:
Quoted 1 line
Reviewed-by Cyril Hrubis <[email protected]>
LGTM as well.
I was thinking a bit if whether to check just for owner permission and ignore group or other, e.g.:
st.st_mode != (S_IFCHR | S_ISUID | S_ISGID)) {
But we probably want strict permission checking, thus:
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
Quoted 3 lines
Systemd changed the default permissions for PTY slave devices from 0620 to 0600 in response to CVE-2024-28085. Allow either 0620 or 0600 as valid permissions.
Thanks, merged!
Kind regards,
Petr
Quoted 19 lines
Signed-off-by Dan Carpenter <[email protected]>Tested-by Anders Roxell <[email protected]>testcases/kernel/pty/common.h +2
-1@@ -54,7 +54,8 @@ static inline int open_slave(const int masterfd) st.st_uid, uid); } -if (st.st_mode != (S_IFCHR |0620 )) { +if (st.st_mode != (S_IFCHR |0620 ) && + st.st_mode != (S_IFCHR |0600 )) {tst_brk (TBROK ,"unexpected slave device permission: %o" , st.st_mode); }
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp