libselinux: add "poly_property" type to X contexts backend
PATCH 1/1 libselinux: add "poly_property" type to X contexts backend
This patch adds a poly_property type to the X contexts backend, so that the X Flask module can be informed which properties to polyinstantiate.
---
include/selinux/label.h | 1 + src/label_x.c | 2 ++ 2 files changed, 3 insertions(+)
include/selinux/label.h +0 -0
@@ -113,6 +113,7 @@
#define SELABEL_X_CLIENT 3
#define SELABEL_X_EVENT 4
#define SELABEL_X_SELN 5
+#define SELABEL_X_POLYPROP 6
#ifdef __cplusplus
src/label_x.c +0 -0
@@ -69,6 +69,8 @@
data->spec_arr[data->nspec].type = SELABEL_X_EVENT;
else if (!strcmp(type, "selection"))
data->spec_arr[data->nspec].type = SELABEL_X_SELN;
+ else if (!strcmp(type, "poly_property"))
+ data->spec_arr[data->nspec].type = SELABEL_X_POLYPROP;
else {
selinux_log(SELINUX_WARNING,
"%s: line %d has invalid object type %s\n",Signature · 8 lines
Eamon Walsh <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
Quoted 42 lines · Eamon Walsh
This patch adds a
poly_propertytype to the X contexts backend, so that the X Flask module can be informed which properties to polyinstantiate.Signed-off-by Eamon Walsh <[email protected]>---
include/selinux/label.h | 1 + src/label_x.c | 2 ++ 2 files changed, 3 insertions(+)Index:
libselinux/include/selinux/label.h
===================================================================include/selinux/label.h (working copy) renamed from include/selinux/label.h (revision 2789) +1
-0@@ -113,6 +113,7 @@ #define SELABEL_X_CLIENT 3 #define SELABEL_X_EVENT 4 #define SELABEL_X_SELN 5 +#define SELABEL_X_POLYPROP 6 #ifdef __cplusplusIndex:
libselinux/src/label_x.c
===================================================================src/label_x.c (working copy) renamed from src/label_x.c (revision 2789) +2
-1@@ -69,6 +69,8 @@ data->spec_arr[data->nspec].type = SELABEL_X_EVENT; else if (!strcmp(type, "selection")) data->spec_arr[data->nspec].type = SELABEL_X_SELN; + else if (!strcmp(type, "poly_property")) + data->spec_arr[data->nspec].type = SELABEL_X_POLYPROP; else { selinux_log(SELINUX_WARNING, "%s: line %d has invalid object type %s\n", --Eamon Walsh <[email protected]>
National Security Agency
Quoted 5 lines
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
The server will check the "property" lines first and if it doesn't find a match it will check the "poly_property" lines. So, as long as the wildcard entry in the x_contexts file is changed from property to poly_property, the default will be to polyinstantiate.
However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
Quoted 52 lines · Eamon Walsh
Quoted 49 lines
This patch adds a
poly_propertytype to the X contexts backend, so that the X Flask module can be informed which properties to polyinstantiate.Signed-off-by Eamon Walsh <[email protected]>---
include/selinux/label.h | 1 + src/label_x.c | 2 ++ 2 files changed, 3 insertions(+)Index:
libselinux/include/selinux/label.h
===================================================================include/selinux/label.h (working copy) renamed from include/selinux/label.h (revision 2789) +1
-0@@ -113,6 +113,7 @@ #define SELABEL_X_CLIENT 3 #define SELABEL_X_EVENT 4 #define SELABEL_X_SELN 5 +#define SELABEL_X_POLYPROP 6 #ifdef __cplusplusIndex:
libselinux/src/label_x.c
===================================================================src/label_x.c (working copy) renamed from src/label_x.c (revision 2789) +2
-1@@ -69,6 +69,8 @@ data->spec_arr[data->nspec].type = SELABEL_X_EVENT; else if (!strcmp(type, "selection")) data->spec_arr[data->nspec].type = SELABEL_X_SELN; + else if (!strcmp(type, "poly_property")) + data->spec_arr[data->nspec].type = SELABEL_X_POLYPROP; else { selinux_log(SELINUX_WARNING, "%s: line %d has invalid object type %s\n", --Eamon Walsh <[email protected]>
National Security Agency--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 8 lines
Eamon Walsh <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 8 lines · Eamon Walsh
Quoted 5 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
Quoted 4 lines
The server will check the "property" lines first and if it doesn't find a match it will check the "
poly_property" lines. So, as long as the wildcard entry in thex_contextsfile is changed from property topoly_property, the default will be to polyinstantiate.However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
Upon further consideration I think I might just add a lookup function to the label API that returns the polyinstantiation bit as a separate argument. This could work with files too.
Quoted 59 lines
Quoted 56 lines · Eamon Walsh
Quoted 51 lines
This patch adds a
poly_propertytype to the X contexts backend, so that the X Flask module can be informed which properties to polyinstantiate.Signed-off-by Eamon Walsh <[email protected]>---
include/selinux/label.h | 1 + src/label_x.c | 2 ++ 2 files changed, 3 insertions(+)Index:
libselinux/include/selinux/label.h
===================================================================include/selinux/label.h (working copy) renamed from include/selinux/label.h (revision 2789) +1
-0@@ -113,6 +113,7 @@ #define SELABEL_X_CLIENT 3 #define SELABEL_X_EVENT 4 #define SELABEL_X_SELN 5 +#define SELABEL_X_POLYPROP 6 #ifdef __cplusplusIndex:
libselinux/src/label_x.c
===================================================================src/label_x.c (working copy) renamed from src/label_x.c (revision 2789) +2
-1@@ -69,6 +69,8 @@ data->spec_arr[data->nspec].type = SELABEL_X_EVENT; else if (!strcmp(type, "selection")) data->spec_arr[data->nspec].type = SELABEL_X_SELN; + else if (!strcmp(type, "poly_property")) + data->spec_arr[data->nspec].type = SELABEL_X_POLYPROP; else { selinux_log(SELINUX_WARNING, "%s: line %d has invalid object type %s\n", --Eamon Walsh <[email protected]>
National Security Agency--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 8 lines
Eamon Walsh <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Eamon Walsh
Quoted 4 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
The server will check the "property" lines first and if it doesn't find a match it will check the "
poly_property" lines. So, as long as the wildcard entry in thex_contextsfile is changed from property topoly_property, the default will be to polyinstantiate.However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
I've never seen a requirement for polyinstantiation of properties on per-client windows. I've seen requirements for relabeling properties, however. For example, the trusted selection manager needs to create properties that are readable by the client who requests a ConvertSelection. We do this by calling a new X protocol extension. How do you plan to have trusted clients act on behalf of other clients with different security contexts? Similarly, how can a trusted client read/write a polyinstantiated property with a different security context?
--Glenn
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Glenn Faden
Quoted 7 lines · Eamon Walsh
Quoted 5 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
Quoted 5 lines
Quoted 4 lines
The server will check the "property" lines first and if it doesn't find a match it will check the "
poly_property" lines. So, as long as the wildcard entry in thex_contextsfile is changed from property topoly_property, the default will be to polyinstantiate.However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
I've never seen a requirement for polyinstantiation of properties on per-client windows. I've seen requirements for relabeling properties, however. For example, the trusted selection manager needs to create properties that are readable by the client who requests a ConvertSelection. We do this by calling a new X protocol extension.
SELinux protocol extension allows clients to create windows and properties with different security contexts.
Quoted 2 lines
How
do you plan to have trusted clients act on behalf of other clients with different security contexts?
I haven't done the polyinstantiation for selections yet, but my current plan is to implement a trusted clipboard manager that will display the various clipboard contents and allow users to upgrade or downgrade, which means that the clipboard manager will take ownership of the selection at the target level and just pipe the data through. This scheme shouldn't require tweaking properties on the fly. However this would not be point-to-point but would make the selection available to all applications at the target level.
Quoted 2 lines
Similarly, how can a trusted client read/write a polyinstantiated property with a different security context?
By launching a helper process at the appropriate level.
Signature · 8 lines
Eamon Walsh <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 13 lines · Eamon Walsh
Quoted 12 lines · Glenn Faden
Quoted 10 lines · Eamon Walsh
Quoted 4 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
The server will check the "property" lines first and if it doesn't find a match it will check the "
poly_property" lines. So, as long as the wildcard entry in thex_contextsfile is changed from property topoly_property, the default will be to polyinstantiate.However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
Quoted 9 lines
Quoted 1 line
I've never seen a requirement for polyinstantiation of properties on per-client windows. I've seen requirements for relabeling properties, however. For example, the trusted selection manager needs to create properties that are readable by the client who requests a ConvertSelection. We do this by calling a new X protocol extension.
SELinux protocol extension allows clients to create windows and properties with different security contexts.
Quoted 2 lines
How do you plan to have trusted clients act on behalf of other
clients with different security contexts?I haven't done the polyinstantiation for selections yet, but my current plan is to implement a trusted clipboard manager that will display the various clipboard contents and allow users to upgrade or downgrade, which means that the clipboard manager will take ownership of the selection at the target level and just pipe the data through. This scheme shouldn't require tweaking properties on the fly. However this would not be point-to-point but would make the selection available to all applications at the target level.
This is extremely high on our list of 'must have's and it is critical that this be targeted for RHEL6 is this your goal too?
Quoted 6 lines
Quoted 2 lines
Similarly, how can a trusted client read/write a polyinstantiated property with a different security context?
By launching a helper process at the appropriate level.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 25 lines · Ted X Toth
Quoted 23 lines · Eamon Walsh
Quoted 11 lines · Glenn Faden
Quoted 8 lines · Eamon Walsh
Quoted 5 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
Quoted 7 lines
Quoted 5 lines
The server will check the "property" lines first and if it doesn't find a match it will check the "
poly_property" lines. So, as long as the wildcard entry in thex_contextsfile is changed from property topoly_property, the default will be to polyinstantiate.However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
I've never seen a requirement for polyinstantiation of properties on per-client windows. I've seen requirements for relabeling properties, however. For example, the trusted selection manager needs to create properties that are readable by the client who requests a ConvertSelection. We do this by calling a new X protocol extension.
SELinux protocol extension allows clients to create windows and properties with different security contexts.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
How do you plan to have trusted clients act on behalf of other
clients with different security contexts?I haven't done the polyinstantiation for selections yet, but my current plan is to implement a trusted clipboard manager that will display the various clipboard contents and allow users to upgrade or downgrade, which means that the clipboard manager will take ownership of the selection at the target level and just pipe the data through. This scheme shouldn't require tweaking properties on the fly. However this would not be point-to-point but would make the selection available to all applications at the target level.
This is extremely high on our list of 'must have's and it is critical that this be targeted for RHEL6 is this your goal too?
Yes, for the server side. However I have no timeline for the trusted clipboard manager application.
Something like Glipper might be a good place to start. What will be needed is to make it aware that the same selection (e.g. PRIMARY) may be owned by different clients at different levels, and implement the downgrading/upgrading feature.
Quoted 16 lines
Quoted 8 lines
Quoted 4 lines
Similarly, how can a trusted client read/write a polyinstantiated property with a different security context?
By launching a helper process at the appropriate level.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Signature · 8 lines
Eamon Walsh <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 32 lines · Eamon Walsh
Quoted 14 lines · Glenn Faden
Quoted 12 lines · Eamon Walsh
Quoted 5 lines · Xavier Toth
I'm curious as to why you chose the route of specifying which properties are polyinstantiated instead of which are not bearing in mind what Glenn said in a previous post?
The server will check the "property" lines first and if it doesn't find a match it will check the "
poly_property" lines. So, as long as the wildcard entry in thex_contextsfile is changed from property topoly_property, the default will be to polyinstantiate.Quoted 8 lines
Quoted 3 lines
However I wasn't planning on treating the root window any differently from other windows, so this behavior would apply to all windows.
I've never seen a requirement for polyinstantiation of properties on per-client windows. I've seen requirements for relabeling properties, however. For example, the trusted selection manager needs to create properties that are readable by the client who requests a ConvertSelection. We do this by calling a new X protocol extension.
SELinux protocol extension allows clients to create windows and properties with different security contexts.
Quoted 3 lines
How
do you plan to have trusted clients act on behalf of other clients with different security contexts?
Quoted 9 lines
I haven't done the polyinstantiation for selections yet, but my current plan is to implement a trusted clipboard manager that will display the various clipboard contents and allow users to upgrade or downgrade, which means that the clipboard manager will take ownership of the selection at the target level and just pipe the data through. This scheme shouldn't require tweaking properties on the fly. However this would not be point-to-point but would make the selection available to all applications at the target level.
Are you thinking of starting with an existing clipboard manager like Glipper?
Quoted 5 lines
Quoted 4 lines
Similarly, how can a trusted client
read/write a polyinstantiated property with a different security context?
Quoted 10 lines
By launching a helper process at the appropriate level.
--
Eamon Walsh <[email protected]>
National Security Agency
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Eamon Walsh
This patch adds a
poly_propertytype to the X contexts backend, so that the X Flask module can be informed which properties to polyinstantiate.Signed-off-by Eamon Walsh <[email protected]>
Quoted 33 lines
---
include/selinux/label.h | 1 + src/label_x.c | 2 ++ 2 files changed, 3 insertions(+)Index:
libselinux/include/selinux/label.h
===================================================================include/selinux/label.h +1
-0@@ -113,6 +113,7 @@#define SELABEL_X_CLIENT 3#define SELABEL_X_EVENT 4#define SELABEL_X_SELN 5 +#define SELABEL_X_POLYPROP 6#ifdef __cplusplusIndex:
libselinux/src/label_x.c
===================================================================src/label_x.c +2
-0@@ -69,6 +69,8 @@ data->spec_arr[data->nspec].type =SELABEL_X_EVENT ; else if (!strcmp(type, "selection")) data->spec_arr[data->nspec].type =SELABEL_X_SELN ; + else if (!strcmp(type, "poly_property")) + data->spec_arr[data->nspec].type =SELABEL_X_POLYPROP ; else { selinux_log(SELINUX_WARNING, "%s: line %d has invalid object type %s\n",
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.