Skip to contentSkip to conversation

quick selinux support for tracefs

PATCH New [email protected] 3 participants 9 messages Dec 6, 2016 – Dec 7, 2016 SELinux security module

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 quick selinux support for tracefs

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux.
just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Change-Id I2aa803ccffbcd2802a7287514da7648e6b364157
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/hooks.c +1 -0
index 09fd610..24bd84d 100644
@@ -491,6 +491,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
 		!strcmp(sb->s_type->name, "sysfs") ||
 		!strcmp(sb->s_type->name, "pstore") ||
 		!strcmp(sb->s_type->name, "debugfs") ||
+		!strcmp(sb->s_type->name, "tracefs") ||
 		!strcmp(sb->s_type->name, "rootfs");
 }
 
Signature · 1 line
2.7.4
#2 lore raw
Quoted 9 lines · On 12/06/2016 12:24 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux.
just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but the right fix is something else if you want this to actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for the right fix:
https://github.com/SELinuxProject/selinux-kernel/issues/2

Quoted 18 lines
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/hooks.c +1 -0
index 09fd610..24bd84d 100644
@@ -491,6 +491,7 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
 		!strcmp(sb->s_type->name, "sysfs") ||
 		!strcmp(sb->s_type->name, "pstore") ||
 		!strcmp(sb->s_type->name, "debugfs") ||
+		!strcmp(sb->s_type->name, "tracefs") ||
 		!strcmp(sb->s_type->name, "rootfs");
 }
 
#3 lore raw
Quoted 19 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 9:41 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 8 lines · On 12/06/2016 12:24 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux. just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Quoted 5 lines
Quoted 1 line

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but

Why would anyone do that for this patch when below you say it won’t be merged unless we fix issue #2?

the right fix is something else if you want this to

Quoted 3 lines

actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for the right fix:
https://github.com/SELinuxProject/selinux-kernel/issues/2

The other question here is tracefs safe to label in this fashion, I would assume yes. Looking through I didn't see any eviction code.

Quoted 19 lines

security/selinux/hooks.c static int selinux_is_sblabel_mnt(struct super_block

Quoted 11 lines
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/hooks.c index renamed from security/selinux/hooks.c +0 -0

09fd610..24bd84d 100644

security/selinux/hooks.c +0 -0
@@ -491,6 +491,7 @@ static int selinux_is_sblabel_mnt(struct super_block

*sb)

Quoted 7 lines
security/selinux/hooks.c +1 -0
 		!strcmp(sb->s_type->name, "sysfs") ||
 		!strcmp(sb->s_type->name, "pstore") ||
 		!strcmp(sb->s_type->name, "debugfs") ||
+		!strcmp(sb->s_type->name, "tracefs") ||
 		!strcmp(sb->s_type->name, "rootfs");  }
 
 
#4 lore raw
Quoted 19 lines · William C
Quoted 19 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 9:41 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 8 lines · On 12/06/2016 12:24 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux. just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but

Why would anyone do that for this patch when below you say it won’t be merged unless we fix issue #2?

I didn't say it couldn't be merged; I said it isn't a good idea to say "this is a quick fix but the right fix is X" in an upstream patch submission if you want it to be merged, unless it is for a serious security or stability bug that needs to be fixed right away.

Quoted 8 lines

the right fix is something else if you want this to

Quoted 3 lines

actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for the right fix:
https://github.com/SELinuxProject/selinux-kernel/issues/2

The other question here is tracefs safe to label in this fashion, I would assume yes. Looking through I didn't see any eviction code.

Yes, the inodes are pinned.

#5 lore raw
Quoted 37 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 10:01 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 26 lines · William C
Quoted 25 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 9:41 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 9 lines · On 12/06/2016 12:24 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux. just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but

Quoted 7 lines
Quoted 2 lines

Why would anyone do that for this patch when below you say it won’t be merged unless we fix issue #2?

I didn't say it couldn't be merged; I said it isn't a good idea to say "this is a quick fix but the right fix is X" in an upstream patch submission if you want it to be merged, unless it is for a serious security or stability bug that needs to be fixed right away.

Oh sure, but I didn't right that patch message, Liu Yonggin is tha author, ill fix up the message and resubmit preserving him as the author.

Quoted 13 lines
Quoted 5 lines

the right fix is something else if you want this to

Quoted 2 lines

actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for the right

fix:

Quoted 3 lines
Quoted 1 line

https://github.com/SELinuxProject/selinux-kernel/issues/2

The other question here is tracefs safe to label in this fashion, I would assume

yes.

Quoted 1 line

Looking through I didn't see any eviction code.

Yes, the inodes are pinned.

#6 lore raw

Hi, Roberts

On 7 December 2016 at 02:05, Roberts, William C <[email protected]

Quoted 46 lines
Quoted 6 lines · wrote:

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 10:01 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <

[email protected]>

Quoted 25 lines

Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 22 lines · William C
Quoted 22 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 9:41 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 9 lines · On 12/06/2016 12:24 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux. just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but

Why would anyone do that for this patch when below you say it won’t be merged unless we fix issue #2?

I didn't say it couldn't be merged; I said it isn't a good idea to say

"this is a quick fix

Quoted 1 line

but the right fix is X" in an upstream patch submission if you want it

Quoted 9 lines

to be

Quoted 1 line

merged, unless it is for a serious security or stability bug that needs

to be fixed

Quoted 1 line

right away.

Oh sure, but I didn't right that patch message, Liu Yonggin is tha author, ill fix up the
message and resubmit preserving him as the author.

This change was submitted to http://android-review.googlesource.com/ via gerrit instructions before,
and now seems that it is going to be submitted via the instructions for kernel changes which I am not familiar.

If you like, please help to update the patch message and submit the patch.

Or you could share me the instructions on how to do that, and then I will submit the changes with new message following your instructions.

Thanks,
Yongqin Liu

Quoted 18 lines
Quoted 6 lines
Quoted 6 lines

the right fix is something else if you want this to

Quoted 2 lines

actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for

the right

Quoted 4 lines

fix:

Quoted 3 lines
Quoted 1 line

https://github.com/SELinuxProject/selinux-kernel/issues/2

The other question here is tracefs safe to label in this fashion, I

would assume

Quoted 4 lines

yes.

Quoted 1 line

Looking through I didn't see any eviction code.

Yes, the inodes are pinned.

Signature · 6 lines
Best Regards,
Yongqin Liu
---------------------------------------------------------------
#mailing list
[email protected] <[email protected]>
http://lists.linaro.org/mailman/listinfo/linaro-android
#7 lore raw

Yes it was submitted to Android’s Gerrit Here by you:
https://android-review.googlesource.com/#/c/220895/

I already modified the commit message and got an Ack on V3 from Stephen:
http://marc.info/?l=selinux&m=148105682211911&w=2

From: YongQin Liu [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 11:06 PM
To: Roberts, William C <[email protected]>
Cc: Stephen Smalley <[email protected]>; [email protected]; [email protected]; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Hi, Roberts

Quoted 35 lines · On 7 December 2016 at 02:05, Roberts, William C…

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]<mailto:[email protected]>]
Sent: Tuesday, December 6, 2016 10:01 AM
To: Roberts, William C <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Yongqin Liu <[email protected]<mailto:[email protected]>>; Paul Moore <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 26 lines · William C
Quoted 25 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]<mailto:[email protected]>]
Sent: Tuesday, December 6, 2016 9:41 AM
To: Roberts, William C <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Yongqin Liu <[email protected]<mailto:[email protected]>>; Paul Moore <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 9 lines · On 12/06/2016 12:24 PM, [email protected]<mailto:william.c.roberts@in…

From: Yongqin Liu <[email protected]<mailto:[email protected]>>

Here is just the quick fix for tracefs with selinux. just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but

Quoted 7 lines
Quoted 2 lines

Why would anyone do that for this patch when below you say it won’t be merged unless we fix issue #2?

I didn't say it couldn't be merged; I said it isn't a good idea to say "this is a quick fix but the right fix is X" in an upstream patch submission if you want it to be merged, unless it is for a serious security or stability bug that needs to be fixed right away.

Oh sure, but I didn't right that patch message, Liu Yonggin is tha author, ill fix up the message and resubmit preserving him as the author.

This change was submitted to http://android-review.googlesource.com/ via gerrit instructions before, and now seems that it is going to be submitted via the instructions for kernel changes which I am not familiar.

If you like, please help to update the patch message and submit the patch.

Or you could share me the instructions on how to do that, and then I will submit the changes with new message following your instructions.

Thanks,
Yongqin Liu

Quoted 5 lines
Quoted 5 lines

the right fix is something else if you want this to

Quoted 2 lines

actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for the right

Quoted 8 lines

fix:

Quoted 3 lines
Quoted 1 line

https://github.com/SELinuxProject/selinux-kernel/issues/2

The other question here is tracefs safe to label in this fashion, I would assume

yes.

Quoted 1 line

Looking through I didn't see any eviction code.

Yes, the inodes are pinned.

--
Best Regards,
Yongqin Liu
---------------------------------------------------------------
#mailing list [email protected]<mailto:[email protected]>
http://lists.linaro.org/mailman/listinfo/linaro-android

#8 lore raw

On 7 December 2016 at 18:59, Roberts, William C <[email protected]

Quoted 4 lines

wrote:

Yes it was submitted to Android’s Gerrit Here by you:

Quoted 10 lines

https://android-review.googlesource.com/#/c/220895/

I already modified the commit message and got an Ack on V3 from Stephen:

http://marc.info/?l=selinux&m=148105682211911&w=2

Thanks, Roberts!

Quoted 131 lines

*From:* YongQin Liu [mailto:[email protected]] *Sent:* Tuesday, December 6, 2016 11:06 PM
*To:* Roberts, William C <[email protected]> *Cc:* Stephen Smalley <[email protected]>; [email protected]; [email protected]; Paul Moore <[email protected]>

*Subject:* Re: [PATCH] quick selinux support for tracefs

Hi, Roberts

Quoted 7 lines · William C

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]

Sent: Tuesday, December 6, 2016 10:01 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <

[email protected]>

Quoted 25 lines

Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 22 lines · William C
Quoted 22 lines

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, December 6, 2016 9:41 AM
To: Roberts, William C <[email protected]>; [email protected]; [email protected]
Cc: Yongqin Liu <[email protected]>; Paul Moore <[email protected]>
Subject: Re: [PATCH] quick selinux support for tracefs

Quoted 9 lines · On 12/06/2016 12:24 PM, [email protected] wrote:

From: Yongqin Liu <[email protected]>

Here is just the quick fix for tracefs with selinux. just add tracefs to the list of whitelisted filesystem types in selinux_is_sblabel_mnt(), but the right fix would be to generalize this logic as described in the last item on the todo list,
https://bitbucket.org/seandroid/wiki/wiki/ToDo

Change-Id: I2aa803ccffbcd2802a7287514da7648e6b364157

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Please rewrite the subject line and patch description per the kernel's submission guidelines, drop the Change-Id and the link to the SEAndroid todo list, and don't say that this is a quick fix but

Why would anyone do that for this patch when below you say it won’t be merged unless we fix issue #2?

I didn't say it couldn't be merged; I said it isn't a good idea to say

"this is a quick fix

Quoted 1 line

but the right fix is X" in an upstream patch submission if you want it

to be

Quoted 1 line

merged, unless it is for a serious security or stability bug that needs

to be fixed

Quoted 1 line

right away.

Oh sure, but I didn't right that patch message, Liu Yonggin is tha author, ill fix up the
message and resubmit preserving him as the author.

This change was submitted to http://android-review.googlesource.com/ via gerrit instructions before,

and now seems that it is going to be submitted via the instructions for kernel changes which I am not familiar.

If you like, please help to update the patch message and submit the patch.

Or you could share me the instructions on how to do that, and then I will submit the changes with new message following your instructions.

Thanks,

Yongqin Liu

Quoted 5 lines
Quoted 5 lines

the right fix is something else if you want this to

Quoted 2 lines

actually be merged. Because in that case, you ought to just implement the right fix. There is now an upstream kernel issue for

the right

Quoted 4 lines

fix:

Quoted 3 lines
Quoted 1 line

https://github.com/SELinuxProject/selinux-kernel/issues/2

The other question here is tracefs safe to label in this fashion, I

would assume

Quoted 4 lines

yes.

Quoted 1 line

Looking through I didn't see any eviction code.

Yes, the inodes are pinned.

--

Best Regards,

Yongqin Liu

---------------------------------------------------------------

#mailing list

[email protected] <[email protected]>

http://lists.linaro.org/mailman/listinfo/linaro-android

Signature · 6 lines
Best Regards,
Yongqin Liu
---------------------------------------------------------------
#mailing list
[email protected] <[email protected]>
http://lists.linaro.org/mailman/listinfo/linaro-android