2017-06-21 15:28:53

by Guido Trentalancia

[permalink] [raw]
Subject: [refpolicy] [PATCH] userdomain: rename USB write boolean

Rename a userdomain boolean to a more meaningful name
and improve its description.

Signed-off-by: Guido Trentalancia <[email protected]>
---
policy/modules/system/userdomain.if | 4 ++--
policy/modules/system/userdomain.te | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff -pru a/policy/modules/system/userdomain.if b/policy/modules/system/userdomain.if
--- a/policy/modules/system/userdomain.if 2017-04-26 17:47:14.081423048 +0200
+++ b/policy/modules/system/userdomain.if 2017-06-21 17:12:39.854541009 +0200
@@ -598,7 +598,7 @@ template(`userdom_common_user_template',
seutil_dontaudit_signal_newrole($1_t)

ifndef(`enable_mls',`
- tunable_policy(`user_write_removable',`
+ tunable_policy(`user_write_usb',`
# Read/write floppies and other removable devices
storage_raw_read_removable_device($1_t)
storage_raw_write_removable_device($1_t)
@@ -625,7 +625,7 @@ template(`userdom_common_user_template',
term_getattr_all_ttys($1_t)
')

- tunable_policy(`user_write_removable',`
+ tunable_policy(`user_write_usb',`
# Read/write USB devices (e.g. external removable USB mass storage devices)
dev_rw_generic_usb_dev($1_t)
',`
diff -pru a/policy/modules/system/userdomain.te b/policy/modules/system/userdomain.te
--- a/policy/modules/system/userdomain.te 2017-04-26 17:47:14.081423048 +0200
+++ b/policy/modules/system/userdomain.te 2017-06-21 17:06:00.276542643 +0200
@@ -51,12 +51,12 @@ gen_tunable(user_exec_noexattrfile, fals

## <desc>
## <p>
-## Allow user to write files on removable
+## Allow user to write files on USB
## devices (e.g. external USB memory
-## devices or floppies)
+## devices or floppies, scanners)
## </p>
## </desc>
-gen_tunable(user_write_removable, false)
+gen_tunable(user_write_usb, false)

## <desc>
## <p>


2017-06-21 16:23:33

by Mira Ressel

[permalink] [raw]
Subject: [refpolicy] [PATCH] userdomain: rename USB write boolean

On Wed, 21 Jun 2017 17:28:53 +0200
Guido Trentalancia via refpolicy <[email protected]> wrote:

> Rename a userdomain boolean to a more meaningful name
> and improve its description.
>
> Signed-off-by: Guido Trentalancia <[email protected]>
> ---
> policy/modules/system/userdomain.if | 4 ++--
> policy/modules/system/userdomain.te | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff -pru a/policy/modules/system/userdomain.if
> b/policy/modules/system/userdomain.if ---
> a/policy/modules/system/userdomain.if 2017-04-26
> 17:47:14.081423048 +0200 +++
> b/policy/modules/system/userdomain.if 2017-06-21
> 17:12:39.854541009 +0200 @@ -598,7 +598,7 @@
> template(`userdom_common_user_template',
> seutil_dontaudit_signal_newrole($1_t) ifndef(`enable_mls',`
> - tunable_policy(`user_write_removable',`
> + tunable_policy(`user_write_usb',`

How on earth is this new name more "meaningful"? If anything, it is
*misleading*. removable_t isn't only used for usb storage devices, but
also for CDs, mmcblk's and various other stuff.

Cheers,
Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20170621/145dfe07/attachment.bin

2017-06-21 16:25:09

by Guido Trentalancia

[permalink] [raw]
Subject: [refpolicy] [PATCH] userdomain: rename USB write boolean

The interface that is called enables writing to USB devices and nothing
else.

On Wed, 21/06/2017 at 18.23 +0200, Luis Ressel wrote:
> On Wed, 21 Jun 2017 17:28:53 +0200
> Guido Trentalancia via refpolicy <[email protected]> wrote:
>
> > Rename a userdomain boolean to a more meaningful name
> > and improve its description.
> >
> > Signed-off-by: Guido Trentalancia <[email protected]>
> > ---
> > policy/modules/system/userdomain.if | 4 ++--
> > policy/modules/system/userdomain.te | 6 +++---
> > 2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff -pru a/policy/modules/system/userdomain.if
> > b/policy/modules/system/userdomain.if ---
> > a/policy/modules/system/userdomain.if 2017-04-26
> > 17:47:14.081423048 +0200 +++
> > b/policy/modules/system/userdomain.if 2017-06-21
> > 17:12:39.854541009 +0200 @@ -598,7 +598,7 @@
> > template(`userdom_common_user_template',
> > seutil_dontaudit_signal_newrole($1_t) ifndef(`enable_mls',`
> > - tunable_policy(`user_write_removable',`
> > + tunable_policy(`user_write_usb',`
>
> How on earth is this new name more "meaningful"? If anything, it is
> *misleading*. removable_t isn't only used for usb storage devices,
> but
> also for CDs, mmcblk's and various other stuff.
>
> Cheers,
> Luis

2017-06-21 16:34:54

by Mira Ressel

[permalink] [raw]
Subject: [refpolicy] [PATCH] userdomain: rename USB write boolean

On Wed, 21 Jun 2017 18:25:09 +0200
Guido Trentalancia via refpolicy <[email protected]> wrote:

> The interface that is called enables writing to USB devices and
> nothing else.

No. userdomain.te calls two interfaces when this
boolean is enabled:
storage_raw_write_removable_device (writing to
removable_t block devices), and dev_rw_generic_usb_dev (writing to
usb_device_t char devices).

Cheers,
Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20170621/937c1122/attachment.bin

2017-06-21 17:01:30

by Guido Trentalancia

[permalink] [raw]
Subject: [refpolicy] [PATCH] userdomain: rename USB write boolean

Yes, you are right !

Please drop this patch then !!

It is misplaced...

Regards,

Guido

On Wed, 21/06/2017 at 18.34 +0200, Luis Ressel wrote:
> On Wed, 21 Jun 2017 18:25:09 +0200
> Guido Trentalancia via refpolicy <[email protected]> wrote:
>
> > The interface that is called enables writing to USB devices and
> > nothing else.
>
> No. userdomain.te calls two interfaces when this
> boolean is enabled:
> storage_raw_write_removable_device (writing to
> removable_t block devices), and dev_rw_generic_usb_dev (writing to
> usb_device_t char devices).
>
> Cheers,
> Luis