public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it, Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [LTP] pty: Update slave device permission check to allow 0600
Date: Mon, 31 Mar 2025 14:56:40 +0200	[thread overview]
Message-ID: <20250331125640.GA215711@pevik> (raw)
In-Reply-To: <Z-p-7Q8OIJYai2Xp@yuki.lan>

Hi all,

> Hi!
> > 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.

> > Link: https://security-tracker.debian.org/tracker/CVE-2024-28085
> > Link: https://github.com/systemd/systemd/commit/a4d18914751e687c9e44f22fe4e5f95b843a45c8
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > Tested-by: Anders Roxell <anders.roxell@linaro.org>

> > diff --git a/testcases/kernel/pty/common.h b/testcases/kernel/pty/common.h
> > index 51760b1d39fa..7cda16096d4d 100644
> > --- a/testcases/kernel/pty/common.h
> > +++ b/testcases/kernel/pty/common.h
> > @@ -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:

> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

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:
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-03-31 12:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31  8:19 [LTP] pty: Update slave device permission check to allow 0600 Dan Carpenter
2025-03-31 11:39 ` Cyril Hrubis
2025-03-31 12:56   ` Petr Vorel [this message]
2025-04-01  7:15 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250331125640.GA215711@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=dan.carpenter@linaro.org \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox