linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] evm: Fix build warnings
@ 2023-06-06  7:41 Roberto Sassu
  2023-06-06  7:41 ` [PATCH 2/2] ima: " Roberto Sassu
  2023-06-06 13:47 ` [PATCH 1/2] evm: " Mimi Zohar
  0 siblings, 2 replies; 4+ messages in thread
From: Roberto Sassu @ 2023-06-06  7:41 UTC (permalink / raw)
  To: zohar, dmitry.kasatkin, paul, jmorris, serge
  Cc: linux-integrity, linux-security-module, linux-kernel,
	Roberto Sassu

From: Roberto Sassu <roberto.sassu@huawei.com>

Fix build warnings (function parameters description) for
evm_read_protected_xattrs(), evm_set_key() and evm_verifyxattr().

Fixes: 7626676320f3 ("evm: provide a function to set the EVM key from the kernel")
Fixes: 8314b6732ae4 ("ima: Define new template fields xattrnames, xattrlengths and xattrvalues")
Fixes: 2960e6cb5f7c ("evm: additional parameter to pass integrity cache entry 'iint'")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
---
 security/integrity/evm/evm_crypto.c | 2 +-
 security/integrity/evm/evm_main.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index 033804f5a5f..0dae649f374 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -40,7 +40,7 @@ static const char evm_hmac[] = "hmac(sha1)";
 /**
  * evm_set_key() - set EVM HMAC key from the kernel
  * @key: pointer to a buffer with the key data
- * @size: length of the key data
+ * @keylen: length of the key data
  *
  * This function allows setting the EVM HMAC key from the kernel
  * without using the "encrypted" key subsystem keys. It can be used
diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
index b1c2197473a..c9b6e2a4347 100644
--- a/security/integrity/evm/evm_main.c
+++ b/security/integrity/evm/evm_main.c
@@ -318,7 +318,6 @@ int evm_protected_xattr_if_enabled(const char *req_xattr_name)
 /**
  * evm_read_protected_xattrs - read EVM protected xattr names, lengths, values
  * @dentry: dentry of the read xattrs
- * @inode: inode of the read xattrs
  * @buffer: buffer xattr names, lengths or values are copied to
  * @buffer_size: size of buffer
  * @type: n: names, l: lengths, v: values
@@ -390,6 +389,7 @@ int evm_read_protected_xattrs(struct dentry *dentry, u8 *buffer,
  * @xattr_name: requested xattr
  * @xattr_value: requested xattr value
  * @xattr_value_len: requested xattr value length
+ * @iint: inode integrity metadata
  *
  * Calculate the HMAC for the given dentry and verify it against the stored
  * security.evm xattr. For performance, use the xattr value and length
-- 
2.25.1


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

* [PATCH 2/2] ima: Fix build warnings
  2023-06-06  7:41 [PATCH 1/2] evm: Fix build warnings Roberto Sassu
@ 2023-06-06  7:41 ` Roberto Sassu
  2023-06-06 15:35   ` Jarkko Sakkinen
  2023-06-06 13:47 ` [PATCH 1/2] evm: " Mimi Zohar
  1 sibling, 1 reply; 4+ messages in thread
From: Roberto Sassu @ 2023-06-06  7:41 UTC (permalink / raw)
  To: zohar, dmitry.kasatkin, paul, jmorris, serge
  Cc: linux-integrity, linux-security-module, linux-kernel,
	Roberto Sassu

From: Roberto Sassu <roberto.sassu@huawei.com>

Fix build warnings (function parameters description) for
ima_collect_modsig(), ima_match_policy() and ima_parse_add_rule().

Fixes: 15588227e086 ("ima: Collect modsig")
Fixes: 2fe5d6def167 ("ima: integrity appraisal extension")
Fixes: 4af4662fa4a9 ("integrity: IMA policy")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
---
 security/integrity/ima/ima_modsig.c | 3 +++
 security/integrity/ima/ima_policy.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/security/integrity/ima/ima_modsig.c b/security/integrity/ima/ima_modsig.c
index fb25723c65b..3e7bee30080 100644
--- a/security/integrity/ima/ima_modsig.c
+++ b/security/integrity/ima/ima_modsig.c
@@ -89,6 +89,9 @@ int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len,
 
 /**
  * ima_collect_modsig - Calculate the file hash without the appended signature.
+ * @modsig: parsed module signature
+ * @buf: data to verify the signature on
+ * @size: data size
  *
  * Since the modsig is part of the file contents, the hash used in its signature
  * isn't the same one ordinarily calculated by IMA. Therefore PKCS7 code
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index 3ca8b7348c2..c9b3bd8f1bb 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -721,6 +721,7 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func)
  * @secid: LSM secid of the task to be validated
  * @func: IMA hook identifier
  * @mask: requested action (MAY_READ | MAY_WRITE | MAY_APPEND | MAY_EXEC)
+ * @flags: IMA actions to consider (e.g. IMA_MEASURE | IMA_APPRAISE)
  * @pcr: set the pcr to extend
  * @template_desc: the template that should be used for this rule
  * @func_data: func specific data, may be NULL
@@ -1915,7 +1916,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
 
 /**
  * ima_parse_add_rule - add a rule to ima_policy_rules
- * @rule - ima measurement policy rule
+ * @rule: ima measurement policy rule
  *
  * Avoid locking by allowing just one writer at a time in ima_write_policy()
  * Returns the length of the rule parsed, an error code on failure
-- 
2.25.1


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

* Re: [PATCH 1/2] evm: Fix build warnings
  2023-06-06  7:41 [PATCH 1/2] evm: Fix build warnings Roberto Sassu
  2023-06-06  7:41 ` [PATCH 2/2] ima: " Roberto Sassu
@ 2023-06-06 13:47 ` Mimi Zohar
  1 sibling, 0 replies; 4+ messages in thread
From: Mimi Zohar @ 2023-06-06 13:47 UTC (permalink / raw)
  To: Roberto Sassu, dmitry.kasatkin, paul, jmorris, serge
  Cc: linux-integrity, linux-security-module, linux-kernel,
	Roberto Sassu

On Tue, 2023-06-06 at 09:41 +0200, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@huawei.com>
> 
> Fix build warnings (function parameters description) for
> evm_read_protected_xattrs(), evm_set_key() and evm_verifyxattr().
> 
> Fixes: 7626676320f3 ("evm: provide a function to set the EVM key from the kernel")
> Fixes: 8314b6732ae4 ("ima: Define new template fields xattrnames, xattrlengths and xattrvalues")
> Fixes: 2960e6cb5f7c ("evm: additional parameter to pass integrity cache entry 'iint'")
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>

Thanks, Roberto.  This patch and 2/2 are now queued in next-integrity.

-- 
Mimi


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

* Re: [PATCH 2/2] ima: Fix build warnings
  2023-06-06  7:41 ` [PATCH 2/2] ima: " Roberto Sassu
@ 2023-06-06 15:35   ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2023-06-06 15:35 UTC (permalink / raw)
  To: Roberto Sassu, zohar, dmitry.kasatkin, paul, jmorris, serge
  Cc: linux-integrity, linux-security-module, linux-kernel,
	Roberto Sassu

On Tue Jun 6, 2023 at 10:41 AM EEST, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@huawei.com>
>
> Fix build warnings (function parameters description) for
> ima_collect_modsig(), ima_match_policy() and ima_parse_add_rule().
>
> Fixes: 15588227e086 ("ima: Collect modsig")
> Fixes: 2fe5d6def167 ("ima: integrity appraisal extension")
> Fixes: 4af4662fa4a9 ("integrity: IMA policy")
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> ---
>  security/integrity/ima/ima_modsig.c | 3 +++
>  security/integrity/ima/ima_policy.c | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/security/integrity/ima/ima_modsig.c b/security/integrity/ima/ima_modsig.c
> index fb25723c65b..3e7bee30080 100644
> --- a/security/integrity/ima/ima_modsig.c
> +++ b/security/integrity/ima/ima_modsig.c
> @@ -89,6 +89,9 @@ int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len,
>  
>  /**
>   * ima_collect_modsig - Calculate the file hash without the appended signature.
> + * @modsig: parsed module signature
> + * @buf: data to verify the signature on
> + * @size: data size
>   *
>   * Since the modsig is part of the file contents, the hash used in its signature
>   * isn't the same one ordinarily calculated by IMA. Therefore PKCS7 code
> diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
> index 3ca8b7348c2..c9b3bd8f1bb 100644
> --- a/security/integrity/ima/ima_policy.c
> +++ b/security/integrity/ima/ima_policy.c
> @@ -721,6 +721,7 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func)
>   * @secid: LSM secid of the task to be validated
>   * @func: IMA hook identifier
>   * @mask: requested action (MAY_READ | MAY_WRITE | MAY_APPEND | MAY_EXEC)
> + * @flags: IMA actions to consider (e.g. IMA_MEASURE | IMA_APPRAISE)
>   * @pcr: set the pcr to extend
>   * @template_desc: the template that should be used for this rule
>   * @func_data: func specific data, may be NULL
> @@ -1915,7 +1916,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
>  
>  /**
>   * ima_parse_add_rule - add a rule to ima_policy_rules
> - * @rule - ima measurement policy rule
> + * @rule: ima measurement policy rule
>   *
>   * Avoid locking by allowing just one writer at a time in ima_write_policy()
>   * Returns the length of the rule parsed, an error code on failure

Acked-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko


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

end of thread, other threads:[~2023-06-06 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06  7:41 [PATCH 1/2] evm: Fix build warnings Roberto Sassu
2023-06-06  7:41 ` [PATCH 2/2] ima: " Roberto Sassu
2023-06-06 15:35   ` Jarkko Sakkinen
2023-06-06 13:47 ` [PATCH 1/2] evm: " Mimi Zohar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).