mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: "Andrew G. Morgan" <morgan@kernel.org>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
	charles.kirsch@internet.lu, lkml <linux-kernel@vger.kernel.org>,
	linux-security-module@vger.kernel.org,
	Gerald Combs <gerald@wireshark.org>,
	Gilbert Ramirez <gram@alumni.rice.edu>,
	Guy Harris <guy@alum.mit.edu>
Subject: Re: Possible problem in linux file posix capabilities
Date: Sun, 17 Feb 2008 19:39:43 -0600	[thread overview]
Message-ID: <20080218013943.GA17142@sergelap.austin.ibm.com> (raw)
In-Reply-To: <47B8DD55.5070800@kernel.org>

Quoting Andrew G. Morgan (morgan@kernel.org):
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Serge E. Hallyn wrote:
> | Andrew, this pretty much was bound to happen...  we need to figure out
> | what our approach here should be.  My preference is still to allow
> | signals when p->uid==current->uid so long as !SECURE_NOROOT.  Then as
> | people start using secure_noroot process trees they at least must know
> | what they're asking for.
>
> I don't think there is anything special about root.
>
> I've been trying to advocate that we remove the *uid == 0 part of this
> check since we discussed it in November:
>
> As I said 11/29/07 [Re: [patch 31/55] file capabilities: don't prevent
> signaling	setuid root programs]:
> | I actually said (11/26/07):
> |> >> Serge,
> |> >>
> |> >> I still feel a bit uneasy about this. Looking ahead, with filesystem
> |> >> capabilities, one can simulate this same situation with a setuid
> |> >> 'non-root' program as follows:
> |> >>
> |> >> [... example of simulating the same situation with setuid-non-root
> ...]
> |> >>
> |> >> Is there a compelling reason to include the euid==0 check?
>
> So, independent of whether SECURE_NOROOT is in effect or not, I think
> this particular line should simply read:
>
> ~        if (p->uid == current->uid)
> ~                 return 0;

Hmm, well unless I misunderstand I think I'm fine with that.  And I must
have completely misunderstood you in November or my memory is just
playing tricks.

So the following patch against current -git is ok with you?

thanks,
-serge

>From bd076c7245d02be0cc01b7c09bd7170ec5946492 Mon Sep 17 00:00:00 2001
From: Serge E. Hallyn <serue@us.ibm.com>
Date: Sun, 17 Feb 2008 20:28:07 -0500
Subject: [PATCH 1/1] file capabilities: simplify signal check

Simplify the uid equivalence check in cap_task_kill().  Anyone
can kill a process owned by the same uid.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 security/commoncap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index 5aba826..bb0c095 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -552,7 +552,7 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
 	 * allowed.
 	 * We must preserve legacy signal behavior in this case.
 	 */
-	if (p->euid == 0 && p->uid == current->uid)
+	if (p->uid == current->uid)
 		return 0;
 
 	/* sigcont is permitted within same session */
-- 
1.5.1.1.GIT


  reply	other threads:[~2008-02-18  1:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17 22:48 Serge E. Hallyn
2008-02-18  1:20 ` Andrew G. Morgan
2008-02-18  1:39   ` Serge E. Hallyn [this message]
2008-02-18  1:55     ` Andrew G. Morgan
2008-02-18  5:17 ` Casey Schaufler
2008-02-18 13:44   ` Serge E. Hallyn

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=20080218013943.GA17142@sergelap.austin.ibm.com \
    --to=serue@us.ibm.com \
    --cc=charles.kirsch@internet.lu \
    --cc=gerald@wireshark.org \
    --cc=gram@alumni.rice.edu \
    --cc=guy@alum.mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=morgan@kernel.org \
    /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

all inboxes | Powered by JetHome®