Skip to contentSkip to conversation

proc.5: Fix SELinux /proc/pid/attr/current example.

PATCH Applied Stephen Smalley 3 participants 3 messages Feb 23, 2015 – Feb 26, 2015 1 message not in the archive

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

PATCH 1/1 proc.5: Fix SELinux /proc/pid/attr/current example.

Since the /proc/pid/attr API was added to the kernel, there have been a couple of changes to the SELinux handling of /proc/pid/attr/current. Fix the SELinux /proc/pid/attr/current example text to reflect these changes and note which kernel versions first included the changes.

---
 man5/proc.5 | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
man5/proc.5 +17 -3
index d01a7a9..68772f3 100644
@@ -101,13 +101,27 @@ This directory is present only if the kernel was configured with
 The contents of this file represent the current
 security attributes of the process.
 
-In SELinux, this file is used to get the security context of a process,
-but not to set the security context (a write is always denied),
-since SELinux limits process security transitions to
+In SELinux, this file is used to get the security context of a process.
+Prior to Linux 2.6.11, this file could not be used to set the security
+context (a write was always denied), since SELinux limited process security
+transitions to
 .BR execve (2)
 (see the description of
 .IR /proc/[pid]/attr/exec ,
 below).
+Since Linux 2.6.11, SELinux lifted this restriction and began supporting
+"set" operations via writes to this node if authorized by policy,
+although use of this operation is only suitable for applications that are
+trusted to maintain any desired separation between the old and new security
+contexts.  Prior to Linux 2.6.28, SELinux did not allow threads within a
+multi-threaded process to set their security context via this node
+as it would yield an inconsistency among the security contexts of the
+threads sharing the same memory space.  Since Linux 2.6.28, SELinux lifted
+this restriction and began supporting "set" operations for threads within
+a multi-threaded process if the new security context is bounded by the old
+security context, where the bounded relation is defined in policy and
+guarantees that the new security context has a subset of the permissions
+of the old security context.
 Other security modules may choose to support "set" operations via
 writes to this node.
 .TP
Signature · 6 lines
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

PATCH 1/1 proc.5: Fix SELinux /proc/pid/attr/current example.

FYI.

-------- Forwarded Message --------
Subject: [PATCH] proc.5: Fix SELinux /proc/pid/attr/current example.
Date: Mon, 23 Feb 2015 10:36:45 -0500
From: Stephen Smalley <[email protected]>
To: [email protected]
CC: [email protected], Stephen Smalley <[email protected]>

Since the /proc/pid/attr API was added to the kernel, there have been a couple of changes to the SELinux handling of /proc/pid/attr/current. Fix the SELinux /proc/pid/attr/current example text to reflect these changes and note which kernel versions first included the changes.

---
 man5/proc.5 | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
man5/proc.5 +0 -0
index d01a7a9..68772f3 100644
@@ -101,13 +101,27 @@ This directory is present only if the kernel was

configured with
The contents of this file represent the current
security attributes of the process.

-In SELinux, this file is used to get the security context of a process, -but not to set the security context (a write is always denied), -since SELinux limits process security transitions to
+In SELinux, this file is used to get the security context of a process. +Prior to Linux 2.6.11, this file could not be used to set the security +context (a write was always denied), since SELinux limited process security +transitions to
.BR execve (2)
(see the description of
.IR /proc/[pid]/attr/exec ,
below).
+Since Linux 2.6.11, SELinux lifted this restriction and began supporting +"set" operations via writes to this node if authorized by policy, +although use of this operation is only suitable for applications that are +trusted to maintain any desired separation between the old and new security +contexts. Prior to Linux 2.6.28, SELinux did not allow threads within a +multi-threaded process to set their security context via this node +as it would yield an inconsistency among the security contexts of the +threads sharing the same memory space. Since Linux 2.6.28, SELinux lifted +this restriction and began supporting "set" operations for threads within +a multi-threaded process if the new security context is bounded by the old +security context, where the bounded relation is defined in policy and +guarantees that the new security context has a subset of the permissions +of the old security context.
Other security modules may choose to support "set" operations via writes to this node.
.TP

Signature · 1 line
1.9.3

A message that is not in the archive (sent off-list or not yet received): 1424705805-2782-1-git-send-email-sds-+05T5uksL2qpZYMLLGbcSA@public.gmane.org

#3 lore raw

Hello Stephen,

Quoted 4 lines · Stephen Smalley

Since the /proc/pid/attr API was added to the kernel, there have been a couple of changes to the SELinux handling of /proc/pid/attr/current. Fix the SELinux /proc/pid/attr/current example text to reflect these changes

Thanks for attending to this.

Quoted 1 line

and note which kernel versions first included the changes.

Perfect!

Applied.

Cheers,

Michael

Quoted 42 lines
---
 man5/proc.5 | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
man5/proc.5 +17 -3
index d01a7a9..68772f3 100644
@@ -101,13 +101,27 @@ This directory is present only if the kernel was configured with
 The contents of this file represent the current
 security attributes of the process.
 
-In SELinux, this file is used to get the security context of a process,
-but not to set the security context (a write is always denied),
-since SELinux limits process security transitions to
+In SELinux, this file is used to get the security context of a process.
+Prior to Linux 2.6.11, this file could not be used to set the security
+context (a write was always denied), since SELinux limited process security
+transitions to
 .BR execve (2)
 (see the description of
 .IR /proc/[pid]/attr/exec ,
 below).
+Since Linux 2.6.11, SELinux lifted this restriction and began supporting
+"set" operations via writes to this node if authorized by policy,
+although use of this operation is only suitable for applications that are
+trusted to maintain any desired separation between the old and new security
+contexts.  Prior to Linux 2.6.28, SELinux did not allow threads within a
+multi-threaded process to set their security context via this node
+as it would yield an inconsistency among the security contexts of the
+threads sharing the same memory space.  Since Linux 2.6.28, SELinux lifted
+this restriction and began supporting "set" operations for threads within
+a multi-threaded process if the new security context is bounded by the old
+security context, where the bounded relation is defined in policy and
+guarantees that the new security context has a subset of the permissions
+of the old security context.
 Other security modules may choose to support "set" operations via
 writes to this node.
 .TP
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html