[PATCH] integrity/ima: Add declarations to init_once void arguments.

Subsystems: extended verification module (evm), integrity measurement architecture (ima), security subsystem, the rest

STALE1954d

6 messages, 3 authors, 2021-04-06 · open the first message on its own page

[PATCH] integrity/ima: Add declarations to init_once void arguments.

From: Jiele Zhao <hidden>
Date: 2021-03-23 01:34:40

init_once is a callback to kmem_cache_create. The parameter
type of this function is void *, so it's better to give a
explicit cast here.

Signed-off-by: Jiele Zhao <redacted>
---
 security/integrity/iint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
 
 static void init_once(void *foo)
 {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
 
 	memset(iint, 0, sizeof(*iint));
 	iint->ima_file_status = INTEGRITY_UNKNOWN;
-- 
2.25.1

Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.

From: Jiele Zhao <hidden>
Date: 2021-03-29 10:20:45

Ping.

On 2021/3/23 9:33, Jiele Zhao wrote:
quoted hunk
init_once is a callback to kmem_cache_create. The parameter
type of this function is void *, so it's better to give a
explicit cast here.

Signed-off-by: Jiele Zhao <redacted>
---
  security/integrity/iint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
  
  static void init_once(void *foo)
  {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
  
  	memset(iint, 0, sizeof(*iint));
  	iint->ima_file_status = INTEGRITY_UNKNOWN;

Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.

From: Jiele Zhao <hidden>
Date: 2021-04-06 02:16:26

Ping.

On 2021/3/23 9:33, Jiele Zhao wrote:
quoted hunk
init_once is a callback to kmem_cache_create. The parameter
type of this function is void *, so it's better to give a
explicit cast here.

Signed-off-by: Jiele Zhao <redacted>
---
  security/integrity/iint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
  
  static void init_once(void *foo)
  {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
  
  	memset(iint, 0, sizeof(*iint));
  	iint->ima_file_status = INTEGRITY_UNKNOWN;

Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.

From: James Morris <jmorris@namei.org>
Date: 2021-04-06 02:42:17

On Tue, 6 Apr 2021, Jiele Zhao wrote:
Ping.
Mimi Zohar is the maintainer for this code.
On 2021/3/23 9:33, Jiele Zhao wrote:
quoted
init_once is a callback to kmem_cache_create. The parameter
type of this function is void *, so it's better to give a
explicit cast here.

Signed-off-by: Jiele Zhao <redacted>
---
  security/integrity/iint.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
  
  static void init_once(void *foo)
  {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache
*)foo;
  
   memset(iint, 0, sizeof(*iint));
   iint->ima_file_status = INTEGRITY_UNKNOWN;
-- 
James Morris
[off-list ref]

Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.

From: Jiele Zhao <hidden>
Date: 2021-04-06 06:24:20

Hi Mimi,

Please see if this is a useful suggestion.

On 2021/4/6 10:38, James Morris wrote:
On Tue, 6 Apr 2021, Jiele Zhao wrote:
quoted
Ping.
Mimi Zohar is the maintainer for this code.
quoted
On 2021/3/23 9:33, Jiele Zhao wrote:
quoted
init_once is a callback to kmem_cache_create. The parameter
type of this function is void *, so it's better to give a
explicit cast here.

Signed-off-by: Jiele Zhao <redacted>
---
   security/integrity/iint.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)
   
   static void init_once(void *foo)
   {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache
*)foo;
   
    memset(iint, 0, sizeof(*iint));
    iint->ima_file_status = INTEGRITY_UNKNOWN;

Re: [PATCH] integrity/ima: Add declarations to init_once void arguments.

From: Mimi Zohar <zohar@linux.ibm.com>
Date: 2021-04-06 12:46:46

Hi Jiele,

On Tue, 2021-03-23 at 01:33 +0000, Jiele Zhao wrote:
init_once is a callback to kmem_cache_create. The parameter
type of this function is void *, so it's better to give a
explicit cast here.

Signed-off-by: Jiele Zhao <redacted>
Please remove the "ima" in the Subject line and re-post Cc'ing the
linux-integrity mailing list.
quoted hunk
---
 security/integrity/iint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..5f3f2de997e1 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -152,7 +152,7 @@ void integrity_inode_free(struct inode *inode)

 static void init_once(void *foo)
 {
-	struct integrity_iint_cache *iint = foo;
+	struct integrity_iint_cache *iint = (struct integrity_iint_cache *)foo;
Like the other init_once() examples, please add a blank before foo.

thanks,

Mimi
 	memset(iint, 0, sizeof(*iint));
 	iint->ima_file_status = INTEGRITY_UNKNOWN;

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help