All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dale Amon <amon@vnl.com>
To: Stephen Smalley <sds@epoch.ncsc.mil>
Cc: Russell Coker <russell@coker.com.au>, Dale Amon <amon@vnl.com>,
	SELinux Mail List <selinux@tycho.nsa.gov>
Subject: Re: ssh policy hassles
Date: Sat, 27 Sep 2003 11:47:35 +0100	[thread overview]
Message-ID: <20030927104735.GA22582@vnl.com> (raw)
In-Reply-To: <1064494538.5099.7.camel@moss-spartans.epoch.ncsc.mil>

I'm still at work on the sshd problem. Just as a summary:

	kernel: 2.6.0-test5
	using devpts
	Russell Coker policy
	Colin's selinux experimental branch debian packages

Via the artifice of 
	/root/newrules.pl > /etc/selinux/domain/tmp.te
	make load

I've been able to get a copy of Colin's ssh source running with
my own added debugging printout. I've (thus far) not been able
to get sshd running under gdb with enforcing on so I can't get
much of a look at the ephemeral /dev/pts.

I've captured the point of failure though, and am not sure why
it should be so since it happens only with enforcing turned on:

#				TEST 1 ENFORCE=1
#
# ssh refuses rhost authentication
Sep 27 11:10:30 cvs ssh(pam_unix)[515]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=scout.islandone.org  
user=root

# ssh accepts password as valid
Sep 27 11:10:37 cvs sshd[515]: Accepted password for root from 10.0.0.25 port 2968 ssh2

# ssh sets security context
Sep 27 11:10:37 cvs sshd[515]: default security context is root:staff_r:staff_t

# ssh has a pty now
Sep 27 11:10:37 cvs sshd[515]: setting tty /dev/pts/0 context to root:object_r:staff_devpts_t

# But it fails a test in sshpty.c where it does a stat on the file and compares the
# results of the stat. The failure is caused by st.gid = 0 instead of the expected 5.
# (DMA is a token on my debug statements)
Sep 27 11:10:37 cvs sshd[515]: fatal: DMA pty=/dev/pts/0 pwuid=0 stuid=0 gid=5 stgid=0 

# We see further failures as it tries to release the pty
Sep 27 11:10:37 cvs sshd[515]: error: chown /dev/pts/0 0 0 failed: Permission denied
Sep 27 11:10:37 cvs sshd[515]: error: chmod /dev/pts/0 0666 failed: Permission denied


#				TEST 1 ENFORCE=0
#
# First part is the same
Sep 27 11:32:45 cvs ssh(pam_unix)[559]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=scout.islandone.org  
user=root
Sep 27 11:32:50 cvs sshd[559]: Accepted password for root from 10.0.0.25 port 2982 ssh2
Sep 27 11:32:50 cvs sshd[559]: default security context is root:staff_r:staff_t
Sep 27 11:32:50 cvs sshd[559]: setting tty /dev/pts/0 context to root:object_r:staff_devpts_t

# But it succeeds and the session is good and the connection works.
Sep 27 11:32:50 cvs ssh(pam_unix)[559]: session opened for user root by (uid=0)
Sep 27 11:32:50 cvs sshd[561]: setting security context to root:staff_r:staff_t

Has anyone a suggestion as to what is happening? There are no avc's at this point so
this looks like something deeper.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2003-09-27 10:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-23 15:09 Some minor thoughts on syntax/semantics Dale Amon
2003-09-23 23:47 ` Brian May
2003-09-24 13:34 ` Russell Coker
2003-09-24 15:17   ` Dale Amon
2003-09-24 20:31   ` ssh policy hassles Dale Amon
2003-09-24 21:20     ` Kerry Thompson
2003-09-25  3:32     ` Russell Coker
2003-09-25 10:44       ` Dale Amon
2003-09-25 11:31         ` Dale Amon
2003-09-25 12:17         ` Dale Amon
2003-09-25 12:21           ` Russell Coker
2003-09-25 12:55             ` Stephen Smalley
2003-09-25 14:20               ` Dale Amon
2003-09-27 10:47               ` Dale Amon [this message]
     [not found] ` <20030927133244.GC22582@vnl.com>
     [not found]   ` <20030927133352.GD22582@vnl.com>
2003-09-27 14:13     ` Russell Coker
2003-09-27 23:00       ` Dale Amon
  -- strict thread matches above, loose matches on Subject: below --
2003-09-24 21:55 Inger, Slav (S.B.)
2003-09-24 22:11 ` Dale Amon
2003-09-24 22:27   ` Dale Amon
2003-09-25  3:01     ` Diyab
2003-09-25  8:30       ` Dale Amon
2003-09-25  6:46   ` Tom
2003-09-25  8:14     ` Russell Coker
2003-09-25 10:29     ` Dale Amon
2003-09-25 12:55       ` Diyab
2003-09-25 16:47         ` Russell Coker
2003-09-26  0:16           ` Diyab
2003-09-26  2:42             ` Russell Coker

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=20030927104735.GA22582@vnl.com \
    --to=amon@vnl.com \
    --cc=russell@coker.com.au \
    --cc=sds@epoch.ncsc.mil \
    --cc=selinux@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.