Skip to contentSkip to conversation

file capabilities: simplify signal check

PATCH In review Serge E. Hallyn 2 participants 3 messages Feb 20, 2008 – Feb 23, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 file capabilities: simplify signal check

Quoted 1 line

From bd076c7245d02be0cc01b7c09bd7170ec5946492 Mon Sep 17 00:00:00 2001

From: Serge E. Hallyn <[email protected]>
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.

Without this patch wireshark is reported to fail.

---
 security/commoncap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
security/commoncap.c +1 -1
index 5aba826..bb0c095 100644
@@ -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 */
Signature · 1 line
1.5.1.1.GIT
#1 lore raw
Quoted 9 lines · On Wed, 20 Feb 2008 10:15:50 -0600 "Serge E. Hallyn" <[email protected]> wrote:
Quoted 1 line

From bd076c7245d02be0cc01b7c09bd7170ec5946492 Mon Sep 17 00:00:00 2001

From: Serge E. Hallyn <[email protected]>
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.

Without this patch wireshark is reported to fail.

Strange that a patch titled "simplify...." actually fixes a bug.

Quoted 11 lines
---
 security/commoncap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
security/commoncap.c +0 -0
index 5aba826..bb0c095 100644

security/commoncap.c int cap_task_kill(struct task_struct *p, struct siginfo *info, · line 558

Quoted 8 lines
security/commoncap.c +1 -1
@@ -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 */

I've marked this as needed-in-2.6.24. Was that appropriate?

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 5 lines · On Wed, 20 Feb 2008 10:15:50 -0600 "Serge E. Hallyn" <[email protected]> wrote:
Quoted 1 line

From bd076c7245d02be0cc01b7c09bd7170ec5946492 Mon Sep 17 00:00:00 2001

From: Serge E. Hallyn <[email protected]>
Date: Sun, 17 Feb 2008 20:28:07 -0500
Subject: [PATCH 1/1] file capabilities: simplify signal check

Quoted 6 lines
Quoted 4 lines

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

Without this patch wireshark is reported to fail.

Strange that a patch titled "simplify...." actually fixes a bug.

Sorry. Yeah that's a bad subject.

Quoted 18 lines
Quoted 18 lines
---
 security/commoncap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
security/commoncap.c +1 -1
index 5aba826..bb0c095 100644
@@ -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;
 
Quoted 3 lines

security/commoncap.c int cap_task_kill(struct task_struct *p, struct siginfo *info, · line 558

Quoted 1 line
security/commoncap.c +0 -0
 	/* sigcont is permitted within same session */

I've marked this as needed-in-2.6.24. Was that appropriate?

Yes, thanks. I doubt wireshark is the only thing that'll break otherwise.

thanks,
-serge