All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ima: Add a space after printing a LSM rule for readability
@ 2020-01-03  7:51 clayc
  2020-01-03 17:11 ` Mimi Zohar
  0 siblings, 1 reply; 3+ messages in thread
From: clayc @ 2020-01-03  7:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-security-module, linux-integrity, zohar, dmitry.kasatkin,
	jmorris, serge, Clay Chang

From: Clay Chang <clayc@hpe.com>

When reading ima_policy from securityfs, there is a missing
space between output string of LSM rules.

Signed-off-by: Clay Chang <clayc@hpe.com>
---
 security/integrity/ima/ima_policy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index ef8dfd47c7e3..1a266e4f99bc 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -1496,6 +1496,7 @@ int ima_policy_show(struct seq_file *m, void *v)
 					   (char *)entry->lsm[i].args_p);
 				break;
 			}
+			seq_puts(m, " ");
 		}
 	}
 	if (entry->template)
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ima: Add a space after printing a LSM rule for readability
  2020-01-03  7:51 [PATCH] ima: Add a space after printing a LSM rule for readability clayc
@ 2020-01-03 17:11 ` Mimi Zohar
  2020-01-05  1:12   ` Clay Chang
  0 siblings, 1 reply; 3+ messages in thread
From: Mimi Zohar @ 2020-01-03 17:11 UTC (permalink / raw)
  To: clayc, linux-kernel
  Cc: linux-security-module, linux-integrity, dmitry.kasatkin, jmorris, serge

On Fri, 2020-01-03 at 15:51 +0800, clayc@hpe.com wrote:
> From: Clay Chang <clayc@hpe.com>

Normally this "From" line is only seen when the sender isn't the patch
author.  Any ideas what happened? 

> 
> When reading ima_policy from securityfs, there is a missing
> space between output string of LSM rules.
> 
> Signed-off-by: Clay Chang <clayc@hpe.com>

Good catch!  IMA policy rules based on LSM labels are used to
constrain which files are in policy.  Normally a single LSM label is
enough (e.g. dont_measure obj_type=auditd_log_t).  Could you include
in this patch description a use case where multiple LSM labels are
needed?

thanks,

Mimi

> ---
>  security/integrity/ima/ima_policy.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index ef8dfd47c7e3..1a266e4f99bc 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -1496,6 +1496,7 @@ int ima_policy_show(struct seq_file *m, void *v)
>  					   (char *)entry->lsm[i].args_p);
>  				break;
>  			}
> +			seq_puts(m, " ");
>  		}
>  	}
>  	if (entry->template)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ima: Add a space after printing a LSM rule for readability
  2020-01-03 17:11 ` Mimi Zohar
@ 2020-01-05  1:12   ` Clay Chang
  0 siblings, 0 replies; 3+ messages in thread
From: Clay Chang @ 2020-01-05  1:12 UTC (permalink / raw)
  To: Mimi Zohar
  Cc: linux-kernel, linux-security-module, linux-integrity,
	dmitry.kasatkin, jmorris, serge

On Fri, Jan 03, 2020 at 12:11:27PM -0500, Mimi Zohar wrote:
> On Fri, 2020-01-03 at 15:51 +0800, clayc@hpe.com wrote:
> > From: Clay Chang <clayc@hpe.com>
> 
> Normally this "From" line is only seen when the sender isn't the patch
> author.  Any ideas what happened? 
>

Hi Mimi,

Apparently I should not use "--from" in git-send-email command.

> > 
> > When reading ima_policy from securityfs, there is a missing
> > space between output string of LSM rules.
> > 
> > Signed-off-by: Clay Chang <clayc@hpe.com>
> 
> Good catch!  IMA policy rules based on LSM labels are used to
> constrain which files are in policy.  Normally a single LSM label is
> enough (e.g. dont_measure obj_type=auditd_log_t).  Could you include
> in this patch description a use case where multiple LSM labels are
> needed?
> 

Apology for not expressed my intention clearly. The intention of this
patch is to add a space after printing LSM rules (if any) and the
remaining rules.

Currently, if I have a policy, for example:
appraise func=BPRM_CHECK obj_type=shell_exec_t appraise_type=imasig

The read back result is:
appraise func=BPRM_CHECK obj_type=shell_exec_tappraise_type=imasig

which is not correct.

I do not have a case for multiple LSM labels, but if there is one
such case, this patch will also apply.

I will post a v2 patch with tuned description.

Thanks,
Clay

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-05  1:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03  7:51 [PATCH] ima: Add a space after printing a LSM rule for readability clayc
2020-01-03 17:11 ` Mimi Zohar
2020-01-05  1:12   ` Clay Chang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.